commonthread-flickr_fu 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +13 -0
- data/Rakefile +40 -8
- data/VERSION.yml +4 -0
- data/flickr_fu.gemspec +114 -33
- data/lib/flickr/base.rb +49 -22
- data/lib/flickr/contact.rb +16 -0
- data/lib/flickr/contacts.rb +55 -0
- data/lib/flickr/geo.rb +42 -0
- data/lib/flickr/location.rb +15 -0
- data/lib/flickr/photo.rb +23 -0
- data/lib/flickr/photos.rb +6 -1
- data/lib/flickr/photoset.rb +36 -0
- data/lib/flickr/photosets.rb +36 -0
- data/lib/flickr/urls.rb +44 -0
- data/lib/flickr_fu.rb +23 -1
- data/spec/fixtures/flickr/contacts/get_list-fail-99.xml +4 -0
- data/spec/fixtures/flickr/contacts/get_public_list-0.xml +7 -0
- data/spec/fixtures/flickr/photos/geo/get_location-0.xml +11 -0
- data/spec/fixtures/flickr/photos/geo/get_location-fail-2.xml +4 -0
- data/spec/fixtures/flickr/photos/get_info-0.xml +41 -0
- data/spec/fixtures/flickr/photos/get_info-1.xml +19 -0
- data/spec/fixtures/flickr/photos/get_sizes-0.xml +10 -0
- data/spec/fixtures/flickr/photos/get_sizes-1.xml +8 -0
- data/spec/fixtures/flickr/photos/licenses/get_info.xml +12 -0
- data/spec/fixtures/flickr/photosets/get_list-0.xml +13 -0
- data/spec/fixtures/flickr/photosets/get_photos-0.xml +7 -0
- data/spec/fixtures/flickr/test/echo-0.xml +5 -0
- data/spec/fixtures/flickr/test/null-fail-99.xml +4 -0
- data/spec/fixtures/flickr/urls/get_group-0.xml +4 -0
- data/spec/fixtures/flickr/urls/get_group-fail-1.xml +4 -0
- data/spec/fixtures/flickr/urls/get_user_photos-0.xml +4 -0
- data/spec/fixtures/flickr/urls/get_user_photos-fail-1.xml +4 -0
- data/spec/fixtures/flickr/urls/get_user_photos-fail-2.xml +4 -0
- data/spec/fixtures/flickr/urls/get_user_profile-0.xml +4 -0
- data/spec/fixtures/flickr/urls/get_user_profile-fail-1.xml +4 -0
- data/spec/fixtures/flickr/urls/get_user_profile-fail-2.xml +4 -0
- data/spec/fixtures/flickr/urls/lookup_group-0.xml +6 -0
- data/spec/fixtures/flickr/urls/lookup_group-fail-1.xml +4 -0
- data/spec/fixtures/flickr/urls/lookup_user-0.xml +6 -0
- data/spec/fixtures/flickr/videos/get_info-0.xml +31 -0
- data/spec/fixtures/flickr/videos/get_sizes-0.xml +13 -0
- data/spec/flickr/base_spec.rb +97 -0
- data/spec/flickr/contacts_spec.rb +47 -0
- data/spec/flickr/errors_spec.rb +21 -0
- data/spec/flickr/geo_spec.rb +20 -0
- data/spec/flickr/photo_spec.rb +123 -0
- data/spec/flickr/photos_spec.rb +50 -0
- data/spec/flickr/photosets_spec.rb +49 -0
- data/spec/flickr/test_spec.rb +34 -0
- data/spec/flickr/urls_spec.rb +99 -0
- data/spec/spec.opts +4 -0
- data/spec/spec_helper.rb +20 -0
- metadata +65 -7
data/.gitignore
ADDED
data/Rakefile
CHANGED
@@ -1,10 +1,35 @@
|
|
1
1
|
require 'rake'
|
2
2
|
require 'rake/rdoctask'
|
3
|
-
|
4
|
-
|
3
|
+
|
4
|
+
# Gem building
|
5
|
+
begin
|
6
|
+
begin
|
7
|
+
require 'jeweler'
|
8
|
+
rescue LoadError
|
9
|
+
require 'rubygems'
|
10
|
+
require 'jeweler'
|
11
|
+
end
|
12
|
+
Jeweler::Tasks.new do |s|
|
13
|
+
s.name = "flickr_fu"
|
14
|
+
s.summary = "Provides a ruby interface to flickr via the REST api"
|
15
|
+
s.email = "ben@commonthread.com"
|
16
|
+
s.homepage = "http://github.com/commonthread/flickr_fu"
|
17
|
+
s.description = "Provides a ruby interface to flickr via the REST api"
|
18
|
+
s.authors = ["Ben Wyrosdick", "Maciej Bilas"]
|
19
|
+
s.rdoc_options = ["--main", "README"]
|
20
|
+
s.extra_rdoc_files = ["README"]
|
21
|
+
s.add_dependency("mime-types", ["> 0.0.0"])
|
22
|
+
s.add_dependency("xml-magic", ["> 0.0.0"])
|
23
|
+
s.files.exclude("spec/spec.local.opts")
|
24
|
+
end
|
25
|
+
rescue LoadError
|
26
|
+
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
27
|
+
end
|
28
|
+
|
29
|
+
desc 'Generate documentation for flickr_fu.'
|
5
30
|
Rake::RDocTask.new(:rdoc) do |rdoc|
|
6
31
|
rdoc.rdoc_dir = 'rdoc'
|
7
|
-
rdoc.title = '
|
32
|
+
rdoc.title = 'flickr_fu'
|
8
33
|
rdoc.options << '--line-numbers' << '--inline-source'
|
9
34
|
rdoc.rdoc_files.include('README')
|
10
35
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
@@ -29,13 +54,20 @@ end
|
|
29
54
|
|
30
55
|
task :default => :spec
|
31
56
|
|
32
|
-
|
33
|
-
Spec::Rake::SpecTask.new do |t|
|
57
|
+
spec_common = Proc.new do |t|
|
34
58
|
t.spec_opts = ['--options', "spec/spec.opts"]
|
59
|
+
t.spec_opts << ['--options', "spec/spec.local.opts" ] if File.exist?(File.dirname(__FILE__) + "/spec/spec.local.opts")
|
35
60
|
t.spec_files = FileList['spec/**/*_spec.rb']
|
36
61
|
end
|
37
62
|
|
38
|
-
desc "Run
|
39
|
-
|
40
|
-
|
63
|
+
desc "Run the specs under spec/models"
|
64
|
+
Spec::Rake::SpecTask.new do |t|
|
65
|
+
spec_common.call(t)
|
66
|
+
end
|
67
|
+
|
68
|
+
desc "Analyze code coverage with tests"
|
69
|
+
Spec::Rake::SpecTask.new("rcov") do |t|
|
70
|
+
spec_common.call(t)
|
71
|
+
t.rcov = true
|
72
|
+
t.rcov_opts = ["-x", "/var/lib", "-x", "spec/", "-T"]
|
41
73
|
end
|
data/VERSION.yml
ADDED
data/flickr_fu.gemspec
CHANGED
@@ -1,36 +1,117 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
1
3
|
Gem::Specification.new do |s|
|
2
|
-
s.name
|
3
|
-
s.version
|
4
|
-
|
5
|
-
s.
|
6
|
-
s.
|
7
|
-
s.
|
8
|
-
s.description =
|
9
|
-
s.
|
10
|
-
s.
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
4
|
+
s.name = %q{flickr_fu}
|
5
|
+
s.version = "0.3.0"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Ben Wyrosdick", "Maciej Bilas"]
|
9
|
+
s.date = %q{2009-05-19}
|
10
|
+
s.description = %q{Provides a ruby interface to flickr via the REST api}
|
11
|
+
s.email = %q{ben@commonthread.com}
|
12
|
+
s.extra_rdoc_files = [
|
13
|
+
"README"
|
14
|
+
]
|
15
|
+
s.files = [
|
16
|
+
".gitignore",
|
17
|
+
"LICENSE",
|
18
|
+
"README",
|
19
|
+
"Rakefile",
|
20
|
+
"VERSION.yml",
|
21
|
+
"flickr_fu.gemspec",
|
22
|
+
"lib/flickr/auth.rb",
|
23
|
+
"lib/flickr/base.rb",
|
24
|
+
"lib/flickr/comment.rb",
|
25
|
+
"lib/flickr/contact.rb",
|
26
|
+
"lib/flickr/contacts.rb",
|
27
|
+
"lib/flickr/errors.rb",
|
28
|
+
"lib/flickr/geo.rb",
|
29
|
+
"lib/flickr/license.rb",
|
30
|
+
"lib/flickr/location.rb",
|
31
|
+
"lib/flickr/note.rb",
|
32
|
+
"lib/flickr/people.rb",
|
33
|
+
"lib/flickr/person.rb",
|
34
|
+
"lib/flickr/photo.rb",
|
35
|
+
"lib/flickr/photo_response.rb",
|
36
|
+
"lib/flickr/photos.rb",
|
37
|
+
"lib/flickr/photoset.rb",
|
38
|
+
"lib/flickr/photosets.rb",
|
39
|
+
"lib/flickr/size.rb",
|
40
|
+
"lib/flickr/status.rb",
|
41
|
+
"lib/flickr/test.rb",
|
42
|
+
"lib/flickr/token.rb",
|
43
|
+
"lib/flickr/uploader.rb",
|
44
|
+
"lib/flickr/urls.rb",
|
45
|
+
"lib/flickr_fu.rb",
|
46
|
+
"spec/fixtures/flickr/contacts/get_list-fail-99.xml",
|
47
|
+
"spec/fixtures/flickr/contacts/get_public_list-0.xml",
|
48
|
+
"spec/fixtures/flickr/photos/geo/get_location-0.xml",
|
49
|
+
"spec/fixtures/flickr/photos/geo/get_location-fail-2.xml",
|
50
|
+
"spec/fixtures/flickr/photos/get_info-0.xml",
|
51
|
+
"spec/fixtures/flickr/photos/get_info-1.xml",
|
52
|
+
"spec/fixtures/flickr/photos/get_sizes-0.xml",
|
53
|
+
"spec/fixtures/flickr/photos/get_sizes-1.xml",
|
54
|
+
"spec/fixtures/flickr/photos/licenses/get_info.xml",
|
55
|
+
"spec/fixtures/flickr/photosets/get_list-0.xml",
|
56
|
+
"spec/fixtures/flickr/photosets/get_photos-0.xml",
|
57
|
+
"spec/fixtures/flickr/test/echo-0.xml",
|
58
|
+
"spec/fixtures/flickr/test/null-fail-99.xml",
|
59
|
+
"spec/fixtures/flickr/urls/get_group-0.xml",
|
60
|
+
"spec/fixtures/flickr/urls/get_group-fail-1.xml",
|
61
|
+
"spec/fixtures/flickr/urls/get_user_photos-0.xml",
|
62
|
+
"spec/fixtures/flickr/urls/get_user_photos-fail-1.xml",
|
63
|
+
"spec/fixtures/flickr/urls/get_user_photos-fail-2.xml",
|
64
|
+
"spec/fixtures/flickr/urls/get_user_profile-0.xml",
|
65
|
+
"spec/fixtures/flickr/urls/get_user_profile-fail-1.xml",
|
66
|
+
"spec/fixtures/flickr/urls/get_user_profile-fail-2.xml",
|
67
|
+
"spec/fixtures/flickr/urls/lookup_group-0.xml",
|
68
|
+
"spec/fixtures/flickr/urls/lookup_group-fail-1.xml",
|
69
|
+
"spec/fixtures/flickr/urls/lookup_user-0.xml",
|
70
|
+
"spec/fixtures/flickr/videos/get_info-0.xml",
|
71
|
+
"spec/fixtures/flickr/videos/get_sizes-0.xml",
|
72
|
+
"spec/flickr/base_spec.rb",
|
73
|
+
"spec/flickr/contacts_spec.rb",
|
74
|
+
"spec/flickr/errors_spec.rb",
|
75
|
+
"spec/flickr/geo_spec.rb",
|
76
|
+
"spec/flickr/photo_spec.rb",
|
77
|
+
"spec/flickr/photos_spec.rb",
|
78
|
+
"spec/flickr/photosets_spec.rb",
|
79
|
+
"spec/flickr/test_spec.rb",
|
80
|
+
"spec/flickr/urls_spec.rb",
|
81
|
+
"spec/spec.opts",
|
82
|
+
"spec/spec_helper.rb"
|
83
|
+
]
|
84
|
+
s.homepage = %q{http://github.com/commonthread/flickr_fu}
|
32
85
|
s.rdoc_options = ["--main", "README"]
|
33
|
-
s.
|
34
|
-
s.
|
35
|
-
s.
|
86
|
+
s.require_paths = ["lib"]
|
87
|
+
s.rubygems_version = %q{1.3.3}
|
88
|
+
s.summary = %q{Provides a ruby interface to flickr via the REST api}
|
89
|
+
s.test_files = [
|
90
|
+
"spec/spec_helper.rb",
|
91
|
+
"spec/flickr/test_spec.rb",
|
92
|
+
"spec/flickr/geo_spec.rb",
|
93
|
+
"spec/flickr/contacts_spec.rb",
|
94
|
+
"spec/flickr/urls_spec.rb",
|
95
|
+
"spec/flickr/errors_spec.rb",
|
96
|
+
"spec/flickr/base_spec.rb",
|
97
|
+
"spec/flickr/photo_spec.rb",
|
98
|
+
"spec/flickr/photosets_spec.rb",
|
99
|
+
"spec/flickr/photos_spec.rb"
|
100
|
+
]
|
101
|
+
|
102
|
+
if s.respond_to? :specification_version then
|
103
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
104
|
+
s.specification_version = 3
|
105
|
+
|
106
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
107
|
+
s.add_runtime_dependency(%q<mime-types>, ["> 0.0.0"])
|
108
|
+
s.add_runtime_dependency(%q<xml-magic>, ["> 0.0.0"])
|
109
|
+
else
|
110
|
+
s.add_dependency(%q<mime-types>, ["> 0.0.0"])
|
111
|
+
s.add_dependency(%q<xml-magic>, ["> 0.0.0"])
|
112
|
+
end
|
113
|
+
else
|
114
|
+
s.add_dependency(%q<mime-types>, ["> 0.0.0"])
|
115
|
+
s.add_dependency(%q<xml-magic>, ["> 0.0.0"])
|
116
|
+
end
|
36
117
|
end
|
data/lib/flickr/base.rb
CHANGED
@@ -22,31 +22,49 @@ module Flickr
|
|
22
22
|
# Flickr::Auth::Token object
|
23
23
|
#
|
24
24
|
# or:
|
25
|
+
#
|
25
26
|
# * config_file (Required)
|
26
27
|
# yaml file to load configuration from
|
27
|
-
# *
|
28
|
-
#
|
29
|
-
#
|
28
|
+
# * options (Optional)
|
29
|
+
# hash containing any of the two options
|
30
|
+
# * token_cache
|
31
|
+
# location of the token cache file. This will override the setting in the config file
|
32
|
+
# * environment
|
33
|
+
# section in the config file that flickr_fu should look for the API key and secret
|
34
|
+
# Useful when using with Rails
|
35
|
+
#
|
30
36
|
# Config Example (yaml file)
|
31
37
|
# ---
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
38
|
+
# key: YOUR_API_KEY
|
39
|
+
# secret: YOUR_API_SECRET
|
40
|
+
# token_cache: token.yml
|
41
|
+
#
|
42
|
+
# Example config file with two environments:
|
43
|
+
# ---
|
44
|
+
# development:
|
45
|
+
# key: YOUR_DEVELOPMENT_API_KEY
|
46
|
+
# secret: YOUR_DEVELOPMENT_API_SECRET
|
47
|
+
# production:
|
48
|
+
# key: YOUR_PRODUCTION_API_KEY
|
49
|
+
# secret: YOUR_PRODUCTION_API_SECRET
|
50
|
+
def initialize(config_param, options_param = {})
|
51
|
+
if options_param.is_a? String
|
52
|
+
options = {:token_cache => options_param}
|
53
|
+
else
|
54
|
+
options = options_param
|
55
|
+
end
|
56
|
+
if config_param.is_a? String
|
57
|
+
config = YAML.load_file(config_param)
|
58
|
+
config = config[options[:environment]] if options.has_key? :environment
|
59
|
+
else
|
60
|
+
config = config_param
|
49
61
|
end
|
62
|
+
@api_key = config[:key] || config["key"]
|
63
|
+
@api_secret = config[:secret] || config["secret"]
|
64
|
+
@token_cache = options[:token_cache] || config["token_cache"]
|
65
|
+
@token = config[:token] || options[:token]
|
66
|
+
raise 'config file must contain an api key and secret' unless @api_key and @api_secret
|
67
|
+
raise 'you cannot specify both the token and token_cache' if @token and @token_cache
|
50
68
|
end
|
51
69
|
|
52
70
|
# sends a request to the flickr REST api
|
@@ -75,7 +93,7 @@ module Flickr
|
|
75
93
|
if xm[:stat] == 'ok'
|
76
94
|
xm
|
77
95
|
else
|
78
|
-
raise Flickr::Errors.error_for(xm.err[:code], xm.err[:msg])
|
96
|
+
raise Flickr::Errors.error_for(xm.err[:code].to_i, xm.err[:msg])
|
79
97
|
end
|
80
98
|
end
|
81
99
|
|
@@ -99,6 +117,9 @@ module Flickr
|
|
99
117
|
# creates and/or returns the Flickr::Photos object
|
100
118
|
def photos() @photos ||= Flickr::Photos.new(self) end
|
101
119
|
|
120
|
+
# creates and/or returns the Flickr::Photos object
|
121
|
+
def photosets() @photosets ||= Flickr::Photosets.new(self) end
|
122
|
+
|
102
123
|
# creates and/or returns the Flickr::People object
|
103
124
|
def people() @people ||= Flickr::People.new(self) end
|
104
125
|
|
@@ -107,7 +128,13 @@ module Flickr
|
|
107
128
|
|
108
129
|
# creates and/or returns the Flickr::Uploader object
|
109
130
|
def uploader() @uploader ||= Flickr::Uploader.new(self) end
|
110
|
-
|
131
|
+
|
132
|
+
# creates and/or returns the Flickr::Contacts object
|
133
|
+
def contacts() @contacts ||= Flickr::Contacts.new(self) end
|
134
|
+
|
135
|
+
# creates and/or returns the Flickr::Urls object
|
136
|
+
def urls() @urls ||= Flickr::Urls.new(self) end
|
137
|
+
|
111
138
|
protected
|
112
139
|
|
113
140
|
# For easier testing. You can mock this method with a XML file you're expecting to receive
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# wrapping class to hold a flickr contact
|
2
|
+
#
|
3
|
+
class Flickr::Contacts::Contact
|
4
|
+
attr_accessor :nsid, :friend, :family, :iconfarm, :iconserver, :location, :username, :ignored, :realname, :path_alias
|
5
|
+
|
6
|
+
# create a new instance of a flickr note.
|
7
|
+
#
|
8
|
+
# Params
|
9
|
+
# * attributes (Required)
|
10
|
+
# a hash of attributes used to set the initial values of the contact object
|
11
|
+
def initialize(attributes)
|
12
|
+
attributes.each do |k,v|
|
13
|
+
send("#{k}=", v)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
class Flickr::Contacts < Flickr::Base
|
2
|
+
def initialize(flickr)
|
3
|
+
@flickr = flickr
|
4
|
+
end
|
5
|
+
|
6
|
+
# Get a user's public contact list.
|
7
|
+
#
|
8
|
+
# Params
|
9
|
+
# * id (Required)
|
10
|
+
# the nsid of the user to get information for
|
11
|
+
#
|
12
|
+
def get_public_list(id, options={})
|
13
|
+
options.merge!({:user_id => id})
|
14
|
+
rsp = @flickr.send_request('flickr.contacts.getPublicList', options)
|
15
|
+
collect_contacts(rsp)
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
# Get the authorized user's contact list.
|
20
|
+
#
|
21
|
+
def get_list(options={})
|
22
|
+
rsp = @flickr.send_request('flickr.contacts.getList', options)
|
23
|
+
collect_contacts(rsp)
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
protected
|
28
|
+
def collect_contacts(rsp)
|
29
|
+
contacts = []
|
30
|
+
return contacts unless rsp
|
31
|
+
if rsp.contacts.contact
|
32
|
+
rsp.contacts.contact.each do |contact|
|
33
|
+
attributes = create_attributes(contact)
|
34
|
+
contacts << Contact.new(attributes)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
return contacts
|
38
|
+
end
|
39
|
+
|
40
|
+
def create_attributes(contact)
|
41
|
+
{
|
42
|
+
:nsid => contact[:nsid],
|
43
|
+
:path_alias => contact[:path_alias],
|
44
|
+
:username => contact[:username],
|
45
|
+
:iconfarm => contact[:iconfarm],
|
46
|
+
:iconserver => contact[:iconserver],
|
47
|
+
:ignored => contact[:ignored],
|
48
|
+
:friend => contact[:friend],
|
49
|
+
:family => contact[:family],
|
50
|
+
:realname => contact[:realname],
|
51
|
+
:location => contact[:location]
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
data/lib/flickr/geo.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
class Flickr::Photos::Geo < Flickr::Base
|
2
|
+
|
3
|
+
def initialize(flickr)
|
4
|
+
@flickr = flickr
|
5
|
+
end
|
6
|
+
|
7
|
+
# Get the geo data (latitude and longitude and the accuracy level) of a photo.
|
8
|
+
#
|
9
|
+
# Params
|
10
|
+
# * photo_id (Required)
|
11
|
+
#
|
12
|
+
# Returns Flickr::Photos::Location object containing photo location
|
13
|
+
# or nil if photo is not geotagged.
|
14
|
+
def get_location(photo_id)
|
15
|
+
# begin
|
16
|
+
rsp = @flickr.send_request('flickr.photos.geo.getLocation', {:photo_id => photo_id})
|
17
|
+
Flickr::Photos::Location.new(:latitude => rsp.photo.location[:latitude].to_f,
|
18
|
+
:longitude => rsp.photo.location[:longitude].to_f, :accuracy => rsp.photo.location[:accuracy].to_i)
|
19
|
+
end
|
20
|
+
|
21
|
+
# Sets the geo data(latitude and longitude and the accuracy level) of a photo.
|
22
|
+
#
|
23
|
+
# Params
|
24
|
+
# * photo_id (Required)
|
25
|
+
# * latittude (Requried)
|
26
|
+
# * longitude (Required)
|
27
|
+
# * accuracy (Optional)
|
28
|
+
#
|
29
|
+
# Returns true if successful, raises an error otherwise.
|
30
|
+
def set_location(photo_id, lat, lon, accuracy = nil)
|
31
|
+
request_options = {:photo_id => photo_id, :lat => lat, :lon => lon}
|
32
|
+
request_options[:accuracy] = accuracy if !accuracy.nil?
|
33
|
+
@flickr.send_request('flickr.photos.geo.setLocation', request_options, :post)
|
34
|
+
true
|
35
|
+
end
|
36
|
+
|
37
|
+
def remove_location(photo_id)
|
38
|
+
request_options = {:photo_id => photo_id}
|
39
|
+
@flickr.send_request('flickr.photos.geo.removeLocation', request_options, :post)
|
40
|
+
true
|
41
|
+
end
|
42
|
+
end
|