flickr_fu 0.1.6 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/.gitignore +13 -0
  2. data/README +38 -1
  3. data/Rakefile +64 -13
  4. data/VERSION.yml +4 -0
  5. data/flickr_fu.gemspec +114 -32
  6. data/lib/flickr/auth.rb +8 -1
  7. data/lib/flickr/base.rb +75 -26
  8. data/lib/flickr/contact.rb +16 -0
  9. data/lib/flickr/contacts.rb +55 -0
  10. data/lib/flickr/errors.rb +20 -0
  11. data/lib/flickr/geo.rb +42 -0
  12. data/lib/flickr/license.rb +10 -0
  13. data/lib/flickr/location.rb +15 -0
  14. data/lib/flickr/photo.rb +130 -107
  15. data/lib/flickr/photos.rb +29 -11
  16. data/lib/flickr/photoset.rb +37 -0
  17. data/lib/flickr/photosets.rb +39 -0
  18. data/lib/flickr/token.rb +1 -1
  19. data/lib/flickr/urls.rb +44 -0
  20. data/lib/flickr_fu.rb +25 -2
  21. data/spec/fixtures/flickr/contacts/get_list-fail-99.xml +4 -0
  22. data/spec/fixtures/flickr/contacts/get_public_list-0.xml +7 -0
  23. data/spec/fixtures/flickr/photos/geo/get_location-0.xml +11 -0
  24. data/spec/fixtures/flickr/photos/geo/get_location-fail-2.xml +4 -0
  25. data/spec/fixtures/flickr/photos/get_info-0.xml +41 -0
  26. data/spec/fixtures/flickr/photos/get_info-1.xml +19 -0
  27. data/spec/fixtures/flickr/photos/get_sizes-0.xml +10 -0
  28. data/spec/fixtures/flickr/photos/get_sizes-1.xml +8 -0
  29. data/spec/fixtures/flickr/photos/licenses/get_info.xml +12 -0
  30. data/spec/fixtures/flickr/photosets/get_list-0.xml +13 -0
  31. data/spec/fixtures/flickr/photosets/get_photos-0.xml +7 -0
  32. data/spec/fixtures/flickr/test/echo-0.xml +5 -0
  33. data/spec/fixtures/flickr/test/null-fail-99.xml +4 -0
  34. data/spec/fixtures/flickr/urls/get_group-0.xml +4 -0
  35. data/spec/fixtures/flickr/urls/get_group-fail-1.xml +4 -0
  36. data/spec/fixtures/flickr/urls/get_user_photos-0.xml +4 -0
  37. data/spec/fixtures/flickr/urls/get_user_photos-fail-1.xml +4 -0
  38. data/spec/fixtures/flickr/urls/get_user_photos-fail-2.xml +4 -0
  39. data/spec/fixtures/flickr/urls/get_user_profile-0.xml +4 -0
  40. data/spec/fixtures/flickr/urls/get_user_profile-fail-1.xml +4 -0
  41. data/spec/fixtures/flickr/urls/get_user_profile-fail-2.xml +4 -0
  42. data/spec/fixtures/flickr/urls/lookup_group-0.xml +6 -0
  43. data/spec/fixtures/flickr/urls/lookup_group-fail-1.xml +4 -0
  44. data/spec/fixtures/flickr/urls/lookup_user-0.xml +6 -0
  45. data/spec/fixtures/flickr/videos/get_info-0.xml +31 -0
  46. data/spec/fixtures/flickr/videos/get_sizes-0.xml +13 -0
  47. data/spec/flickr/base_spec.rb +97 -0
  48. data/spec/flickr/contacts_spec.rb +47 -0
  49. data/spec/flickr/errors_spec.rb +21 -0
  50. data/spec/flickr/geo_spec.rb +20 -0
  51. data/spec/flickr/photo_spec.rb +140 -0
  52. data/spec/flickr/photos_spec.rb +50 -0
  53. data/spec/flickr/photosets_spec.rb +49 -0
  54. data/spec/flickr/test_spec.rb +34 -0
  55. data/spec/flickr/urls_spec.rb +99 -0
  56. data/spec/spec.opts +4 -0
  57. data/spec/spec_helper.rb +20 -0
  58. metadata +66 -7
data/lib/flickr/photos.rb CHANGED
@@ -111,6 +111,8 @@ class Flickr::Photos < Flickr::Base
111
111
  # Number of photos to return per page. If this argument is omitted, it defaults to 100. The maximum allowed value is 500.
112
112
  # * page (Optional)
113
113
  # The page of results to return. If this argument is omitted, it defaults to 1.
114
+ # * media (Optional)
115
+ # The type of media to search for. 'photo', 'video', or 'both' are allowed arguments, with 'both' being the default.
114
116
  #
115
117
  def search(options)
116
118
  options.merge!({:extras => "license,date_upload,date_taken,owner_name,icon_server,original_format,last_update,geo,tags,machine_tags,o_dims,views,media"})
@@ -143,8 +145,10 @@ class Flickr::Photos < Flickr::Base
143
145
  # Number of photos to return per page. If this argument is omitted, it defaults to 100. The maximum allowed value is 500.
144
146
  # * page (Optional)
145
147
  # The page of results to return. If this argument is omitted, it defaults to 1.
148
+ # * media (Optional)
149
+ # The type of media to search for. 'photo', 'video', or 'both' are allowed arguments, with 'both' being the default.
146
150
  #
147
- def get_recent(options)
151
+ def get_recent(options = {})
148
152
  options.merge!({:extras => "license,date_upload,date_taken,owner_name,icon_server,original_format,last_update,geo,tags,machine_tags,o_dims,views,media"})
149
153
 
150
154
  rsp = @flickr.send_request('flickr.photos.getRecent', options)
@@ -187,7 +191,30 @@ class Flickr::Photos < Flickr::Base
187
191
  end
188
192
 
189
193
  def licenses
190
- @licenses ||= get_licenses
194
+ @licenses ||= begin
195
+ rsp = @flickr.send_request('flickr.photos.licenses.getInfo')
196
+
197
+ returning Hash.new do |licenses|
198
+ rsp.licenses.license.each do |license|
199
+ licenses[license[:id].to_i] = Flickr::Photos::License.new(:id => license[:id].to_i, :name => license[:name], :url => license[:url])
200
+ end
201
+ end
202
+ end
203
+ end
204
+
205
+ # creates and/or returns the Flickr::Photos::Geo object
206
+ def geo
207
+ @geo ||= Flickr::Photos::Geo.new(@flickr)
208
+ end
209
+
210
+ # Returns a Flickr::Photos::Photo object of the given id.
211
+ # Raises an error if photo not found
212
+ def find_by_id(photo_id)
213
+ rsp = @flickr.send_request('flickr.photos.getInfo', :photo_id => photo_id)
214
+ Photo.new(@flickr, :id => rsp.photo[:id].to_i, :owner => rsp.photo.owner,
215
+ :secret => rsp.photo[:secret], :server => rsp.photo[:server].to_i, :farm => rsp.photo[:farm],
216
+ :title => rsp.photo.title,
217
+ :is_public => rsp.photo.visibility[:public], :is_friend => rsp.photo.visibility[:is_friend], :is_family => rsp.photo.visibility[:is_family])
191
218
  end
192
219
 
193
220
  protected
@@ -216,13 +243,4 @@ class Flickr::Photos < Flickr::Base
216
243
  :media => photo[:media]}
217
244
  end
218
245
 
219
- def get_licenses
220
- rsp = @flickr.send_request('flickr.photos.licenses.getInfo')
221
-
222
- returning Hash.new do |licenses|
223
- rsp.licenses.license.each do |license|
224
- licenses[license[:id].to_i] = Flickr::Photos::License.new(:id => license[:id].to_i, :name => license[:name], :url => license[:url])
225
- end
226
- end
227
- end
228
246
  end
@@ -0,0 +1,37 @@
1
+ class Flickr::Photosets::Photoset
2
+ attr_accessor :id,:num_photos,:title,:description
3
+
4
+ def initialize(flickr, attributes)
5
+ @flickr = flickr
6
+ attributes.each do |k,v|
7
+ send("#{k}=", v)
8
+ end
9
+ end
10
+
11
+ def get_photos(options={})
12
+ options = options.merge(:photoset_id=>id)
13
+ rsp = @flickr.send_request('flickr.photosets.getPhotos', options)
14
+ collect_photos(rsp)
15
+ end
16
+
17
+ protected
18
+ def collect_photos(rsp)
19
+ photos = []
20
+ return photos unless rsp
21
+ if rsp.photoset.photo
22
+ rsp.photoset.photo.each do |photo|
23
+ attributes = create_attributes(photo)
24
+ photos << Flickr::Photos::Photo.new(@flickr,attributes)
25
+ end
26
+ end
27
+ return photos
28
+ end
29
+
30
+ def create_attributes(photo)
31
+ {:id => photo[:id],
32
+ :secret => photo[:secret],
33
+ :server => photo[:server],
34
+ :farm => photo[:farm],
35
+ :title => photo[:title]}
36
+ end
37
+ end
@@ -0,0 +1,39 @@
1
+ class Flickr::Photosets < Flickr::Base
2
+ def initialize(flickr)
3
+ @flickr = flickr
4
+ end
5
+
6
+ # Get the authorized user's contact list.
7
+ #
8
+ def get_list(options={})
9
+ rsp = @flickr.send_request('flickr.photosets.getList', options)
10
+ collect_photosets(rsp)
11
+ end
12
+
13
+ protected
14
+ def collect_photosets(rsp)
15
+ photosets = []
16
+ return photosets unless rsp
17
+ if rsp.photosets.photoset
18
+ rsp.photosets.photoset.each do |photoset|
19
+ attributes = create_attributes(photoset)
20
+ photosets << Photoset.new(@flickr, attributes)
21
+ end
22
+ end
23
+ return photosets
24
+ end
25
+
26
+ def create_attributes(photoset)
27
+ # comment by : smeevil
28
+ #
29
+ # for some reason it was needed to call to_s on photoset.title and photoset.description
30
+ # without this it will not set the value correctly
31
+ {
32
+ :id => photoset[:id],
33
+ :num_photos => photoset[:photos],
34
+ :title => photoset.title.to_s,
35
+ :description => photoset.description.to_s
36
+ }
37
+ end
38
+
39
+ end
data/lib/flickr/token.rb CHANGED
@@ -10,7 +10,7 @@ class Flickr::Auth::Token
10
10
  # a hash of attributes used to set the initial values of the token object
11
11
  def initialize(attributes)
12
12
  attributes.each do |k,v|
13
- send("#{k}=", v)
13
+ send("#{k}=", v) if respond_to?("#{k}=")
14
14
  end
15
15
  end
16
16
 
@@ -0,0 +1,44 @@
1
+ # Wrapping class that holds methods in the flickr.urls namespace
2
+ class Flickr::Urls < Flickr::Base
3
+ def initialize(flickr)
4
+ @flickr = flickr
5
+ end
6
+
7
+ def get_group group_id
8
+ rsp = @flickr.send_request('flickr.urls.getGroup', {:group_id => group_id})
9
+ rsp.group[:url]
10
+ end
11
+
12
+ def get_user_photos user_id
13
+ rsp = @flickr.send_request('flickr.urls.getUserPhotos', {:user_id => user_id})
14
+ rsp.user[:url]
15
+ end
16
+
17
+ def get_user_profile user_id
18
+ rsp = @flickr.send_request('flickr.urls.getUserProfile', {:user_id => user_id})
19
+ rsp.user[:url]
20
+ end
21
+
22
+ def lookup_group url #, options = {}
23
+ #options.symbolize_keys!
24
+ #options.reverse_merge!({:include_groupname => false})
25
+ rsp = @flickr.send_request('flickr.urls.lookupGroup', {:url => url})
26
+ #if options[:include_groupname]
27
+ #[rsp.group[:id], {:groupname => rsp.group.groupname}]
28
+ #else
29
+ rsp.group[:id]
30
+ #end
31
+ end
32
+
33
+ def lookup_user url
34
+ rsp = @flickr.send_request('flickr.urls.lookupUser', {:url => url})
35
+ user_id = UserLookupResult.new(rsp.user[:id])
36
+ user_id.username = rsp.user.username
37
+ user_id
38
+ end
39
+
40
+ class UserLookupResult < String
41
+ attr_accessor :username
42
+ end
43
+
44
+ end
data/lib/flickr_fu.rb CHANGED
@@ -3,6 +3,7 @@ require 'xml_magic'
3
3
  require 'net/http'
4
4
  require 'cgi'
5
5
  require 'uri'
6
+ require 'open-uri'
6
7
  require 'mime/types'
7
8
  require 'digest/md5'
8
9
  require 'yaml'
@@ -10,7 +11,29 @@ require 'time'
10
11
  require 'date'
11
12
 
12
13
  # base must load first
13
- %w(base test auth token photos photo photo_response comment note size uploader status people person license).each do |file|
14
+ [ "base",
15
+ "test",
16
+ "auth",
17
+ "token",
18
+ "photos",
19
+ "photo",
20
+ "photo_response",
21
+ "photosets",
22
+ "photoset",
23
+ "comment",
24
+ "note",
25
+ "size",
26
+ "uploader",
27
+ "status",
28
+ "people",
29
+ "person",
30
+ "license",
31
+ "errors",
32
+ "contacts",
33
+ "contact",
34
+ "geo",
35
+ "location",
36
+ "urls" ].each do |file|
14
37
  require File.join(File.dirname(__FILE__), 'flickr', file)
15
38
  end
16
39
 
@@ -22,4 +45,4 @@ class Object
22
45
  yield(value)
23
46
  value
24
47
  end
25
- end
48
+ end
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <rsp stat="fail">
3
+ <err code="99" msg="Insufficient permissions. Method requires read privileges; none granted."/>
4
+ </rsp>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <rsp stat="ok">
3
+ <contacts page="1" pages="1" per_page="1000" perpage="1000" total="2">
4
+ <contact nsid="40718771@N00" username="kooop" iconserver="2" iconfarm="1" ignored="0" />
5
+ <contact nsid="20039881@N00" username="wayoutwest" iconserver="1" iconfarm="1" ignored="0" />
6
+ </contacts>
7
+ </rsp>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <rsp stat="ok">
3
+ <photo id="2984637736">
4
+ <location latitude="50.041376" longitude="21.999006" accuracy="16" context="0" place_id="X.5ul_ucAJtJcT0" woeid="517126">
5
+ <locality place_id="X.5ul_ucAJtJcT0" woeid="517126">Rzeszów</locality>
6
+ <county place_id="gUrbqNqYA5n4kv.erw" woeid="12591341">Rzeszów</county>
7
+ <region place_id="acDFruGYA5lyOpcIVg" woeid="12577943">Subcarpathia</region>
8
+ <country place_id="0kV97TybAphIxvm14g" woeid="23424923">Poland</country>
9
+ </location>
10
+ </photo>
11
+ </rsp>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <rsp stat="fail">
3
+ <err code="2" msg="Photo has no location information."/>
4
+ </rsp>
@@ -0,0 +1,41 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <rsp stat="ok">
3
+ <photo id="2984637736" secret="9e5762e027" server="3180" farm="4" dateuploaded="1225297614" isfavorite="0" license="0" rotation="0" media="photo">
4
+ <owner nsid="80755658@N00" username="Maciej Biłas" realname="Maciej Biłas" location="Rzeszów, Poland"/>
5
+ <title>Demolition of Hotel Rzeszów</title>
6
+ <description>
7
+ The last picture from a quite old event. The demolition of the best known hotel in Rzeszów called Hotel Rzeszów.
8
+ </description>
9
+ <visibility ispublic="1" isfriend="0" isfamily="0"/>
10
+ <dates posted="1225297614" taken="2007-04-20 17:56:06" takengranularity="0" lastupdate="1227358764"/>
11
+ <editability cancomment="0" canaddmeta="0"/>
12
+ <usage candownload="0" canblog="0" canprint="0"/>
13
+ <comments>0</comments>
14
+ <notes/>
15
+ <tags>
16
+ <tag id="4963651-2984637736-9769036" author="80755658@N00" raw="Hotel Rzeszów" machine_tag="0">hotelrzeszów
17
+ </tag>
18
+ <tag id="4963651-2984637736-9381" author="80755658@N00" raw="demolition" machine_tag="0">demolition
19
+ </tag>
20
+ <tag id="4963651-2984637736-1888184" author="80755658@N00" raw="Rzeszów" machine_tag="0">rzeszów
21
+ </tag>
22
+ <tag id="4963651-2984637736-8302" author="80755658@N00" raw="Poland" machine_tag="0">poland
23
+ </tag>
24
+ </tags>
25
+ <location latitude="50.041376" longitude="21.999006" accuracy="16" place_id="X.5ul_ucAJtJcT0" woeid="517126">
26
+ <locality place_id="X.5ul_ucAJtJcT0" woeid="517126">Rzeszów
27
+ </locality>
28
+ <county place_id="gUrbqNqYA5n4kv.erw" woeid="12591341">Rzeszów
29
+ </county>
30
+ <region place_id="acDFruGYA5lyOpcIVg" woeid="12577943">Subcarpathia
31
+ </region>
32
+ <country place_id="0kV97TybAphIxvm14g" woeid="23424923">Poland
33
+ </country>
34
+ </location>
35
+ <geoperms ispublic="1" iscontact="0" isfriend="0" isfamily="0"/>
36
+ <urls>
37
+ <url type="photopage">http://www.flickr.com/photos/lvizard/2984637736/
38
+ </url>
39
+ </urls>
40
+ </photo>
41
+ </rsp>
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <rsp stat="ok">
3
+ <photo id="3059178826" secret="951324cc9f" server="3008" farm="4" dateuploaded="1227628465" isfavorite="0" license="0" rotation="0" originalsecret="fdbf0e4ced" originalformat="jpg" views="0" media="photo">
4
+ <owner nsid="80755658@N00" username="Maciej Biłas" realname="Maciej Biłas" location="Rzeszów, Poland"/>
5
+ <title>test</title>
6
+ <description/>
7
+ <visibility ispublic="0" isfriend="0" isfamily="0"/>
8
+ <dates posted="1227628465" taken="2008-11-25 16:54:25" takengranularity="0" lastupdate="1227628476"/>
9
+ <permissions permcomment="3" permaddmeta="2"/>
10
+ <editability cancomment="1" canaddmeta="1"/>
11
+ <usage candownload="0" canblog="1" canprint="1"/>
12
+ <comments>0</comments>
13
+ <notes/>
14
+ <tags/>
15
+ <urls>
16
+ <url type="photopage">http://www.flickr.com/photos/lvizard/3059178826/</url>
17
+ </urls>
18
+ </photo>
19
+ </rsp>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <rsp stat="ok">
3
+ <sizes canblog="0" canprint="0" candownload="0">
4
+ <size label="Square" width="75" height="75" source="http://farm4.static.flickr.com/3180/2984637736_9e5762e027_s.jpg" url="http://www.flickr.com/photos/lvizard/2984637736/sizes/sq/" media="photo"/>
5
+ <size label="Thumbnail" width="100" height="67" source="http://farm4.static.flickr.com/3180/2984637736_9e5762e027_t.jpg" url="http://www.flickr.com/photos/lvizard/2984637736/sizes/t/" media="photo"/>
6
+ <size label="Small" width="240" height="160" source="http://farm4.static.flickr.com/3180/2984637736_9e5762e027_m.jpg" url="http://www.flickr.com/photos/lvizard/2984637736/sizes/s/" media="photo"/>
7
+ <size label="Medium" width="500" height="333" source="http://farm4.static.flickr.com/3180/2984637736_9e5762e027.jpg" url="http://www.flickr.com/photos/lvizard/2984637736/sizes/m/" media="photo"/>
8
+ <size label="Large" width="1024" height="683" source="http://farm4.static.flickr.com/3180/2984637736_9e5762e027_b.jpg" url="http://www.flickr.com/photos/lvizard/2984637736/sizes/l/" media="photo"/>
9
+ </sizes>
10
+ </rsp>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <rsp stat="ok">
3
+ <sizes canblog="1" canprint="1" candownload="0">
4
+ <size label="Square" width="75" height="75" source="http://farm4.static.flickr.com/3008/3059178826_951324cc9f_s.jpg" url="http://www.flickr.com/photos/lvizard/3059178826/sizes/sq/" media="photo"/>
5
+ <size label="Thumbnail" width="70" height="72" source="http://farm4.static.flickr.com/3008/3059178826_951324cc9f_t.jpg" url="http://www.flickr.com/photos/lvizard/3059178826/sizes/t/" media="photo"/>
6
+ <size label="Original" width="70" height="72" source="http://farm4.static.flickr.com/3008/3059178826_fdbf0e4ced_o.jpg" url="http://www.flickr.com/photos/lvizard/3059178826/sizes/o/" media="photo"/>
7
+ </sizes>
8
+ </rsp>
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <rsp stat="ok">
3
+ <licenses>
4
+ <license id="0" name="All Rights Reserved" url=""/>
5
+ <license id="4" name="Attribution License" url="http://creativecommons.org/licenses/by/2.0/"/>
6
+ <license id="6" name="Attribution-NoDerivs License" url="http://creativecommons.org/licenses/by-nd/2.0/"/>
7
+ <license id="3" name="Attribution-NonCommercial-NoDerivs License" url="http://creativecommons.org/licenses/by-nc-nd/2.0/"/>
8
+ <license id="2" name="Attribution-NonCommercial License" url="http://creativecommons.org/licenses/by-nc/2.0/"/>
9
+ <license id="1" name="Attribution-NonCommercial-ShareAlike License" url="http://creativecommons.org/licenses/by-nc-sa/2.0/"/>
10
+ <license id="5" name="Attribution-ShareAlike License" url="http://creativecommons.org/licenses/by-sa/2.0/"/>
11
+ </licenses>
12
+ </rsp>
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <rsp stat="ok">
3
+ <photosets cancreate="1">
4
+ <photoset id="5" primary="2483" secret="abcdef" server="8" photos="4" farm="1">
5
+ <title>Test</title>
6
+ <description>foo</description>
7
+ </photoset>
8
+ <photoset id="4" primary="1234" secret="832659" server="3" photos="12" farm="1">
9
+ <title>My Set</title>
10
+ <description>bar</description>
11
+ </photoset>
12
+ </photosets>
13
+ </rsp>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <rsp stat="ok">
3
+ <photoset id="4" primary="2483" page="1" perpage="500" pages="1" total="2">
4
+ <photo id="2484" secret="123456" server="1" title="my photo" isprimary="0" />
5
+ <photo id="2483" secret="123456" server="1" title="flickr rocks" isprimary="1" />
6
+ </photoset>
7
+ </rsp>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <rsp stat="ok">
3
+ <method>flickr.test.echo</method>
4
+ <foo>bar</foo>
5
+ </rsp>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <rsp stat="fail">
3
+ <err code="99" msg="Insufficient permissions. Method requires read privileges; none granted."/>
4
+ </rsp>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <rsp stat="ok">
3
+ <group nsid="34427469792@N01" url="http://www.flickr.com/groups/central/"/>
4
+ </rsp>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <rsp stat="fail">
3
+ <err code="1" msg="Group not found"/>
4
+ </rsp>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <rsp stat="ok">
3
+ <user nsid="80755658@N00" url="http://www.flickr.com/photos/lvizard/"/>
4
+ </rsp>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <rsp stat="fail">
3
+ <err code="1" msg="User not found"/>
4
+ </rsp>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <rsp stat="fail">
3
+ <err code="2" msg="No user specified"/>
4
+ </rsp>