public
Description: An update of Scott Raymond's insanely easy flickr library
Clone URL: git://github.com/ctagg/flickr.git
Documentation update
Chris Taggart (author)
Tue May 13 11:38:57 -0700 2008
commit  eb7596daccbd0f73dbdf873828fbba07825cbb6e
tree    d39f7dda6c291d18cd9ae064f65df6b7cd37847a
parent  96b232ab9c361d4b6bd626b321c800276e1fb4bf
...
1
2
3
 
4
5
6
7
 
8
9
10
11
 
 
12
13
14
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
17
18
...
1
2
 
3
4
5
6
 
7
8
9
10
 
11
12
13
14
15
 
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
0
@@ -1,18 +1,43 @@
0
 = flickr
0
 
0
-* FIX (url)
0
+http://github.com/ctagg/flickr
0
 
0
 == DESCRIPTION:
0
 
0
-FIX (describe your package)
0
+An insanely easy interface to the Flickr photo-sharing service. By Scott Raymond. (& updated May 08 by Chris Taggart, http://pushrod.wordpress.com)
0
 
0
 == FEATURES/PROBLEMS:
0
 
0
-* FIX (list of features or problems)
0
+The flickr gem (famously featured in a RubyonRails screencast) had broken with Flickr's new authentication scheme and updated API.
0
+This has now been largely corrected, though not all current API calls are supported yet.
0
 
0
 == SYNOPSIS:
0
 
0
- FIX (code sample of usage)
0
+require 'flickr'
0
+flickr = Flickr.new('some_flickr_api_key') # create a flickr client (get an API key from http://www.flickr.com/services/api/)
0
+user = flickr.users('sco@scottraymond.net') # lookup a user
0
+user.name # get the user's name
0
+user.location # and location
0
+user.photos # grab their collection of Photo objects...
0
+user.groups # ...the groups they're in...
0
+user.contacts # ...their contacts...
0
+user.favorites # ...favorite photos...
0
+user.photosets # ...their photo sets...
0
+user.tags # ...and their tags
0
+recentphotos = flickr.photos # get the 100 most recent public photos
0
+photo = recentphotos.first # or very most recent one
0
+photo.url # see its URL,
0
+photo.title # title,
0
+photo.description # and description,
0
+photo.owner # and its owner.
0
+File.open(photo.filename, 'w') do |file|
0
+ file.puts p.file # save the photo to a local file
0
+end
0
+flickr.photos.each do |p| # get the last 100 public photos...
0
+ File.open(p.filename, 'w') do |f|
0
+ f.puts p.file('Square') # ...and save a local copy of their square thumbnail
0
+ end
0
+end
0
 
0
 == REQUIREMENTS:
0
 
...
9
10
11
12
 
13
14
15
...
18
19
20
21
22
 
 
23
24
25
...
9
10
11
 
12
13
14
15
...
18
19
20
 
 
21
22
23
24
25
0
@@ -9,7 +9,7 @@
0
 # require 'flickr'
0
 # flickr = Flickr.new('some_flickr_api_key') # create a flickr client (get an API key from http://www.flickr.com/services/api/)
0
 # user = flickr.users('sco@scottraymond.net') # lookup a user
0
-# user.getInfo.name # get the user's name
0
+# user.name # get the user's name
0
 # user.location # and location
0
 # user.photos # grab their collection of Photo objects...
0
 # user.groups # ...the groups they're in...
0
@@ -18,8 +18,8 @@
0
 # user.photosets # ...their photo sets...
0
 # user.tags # ...and their tags
0
 # recentphotos = flickr.photos # get the 100 most recent public photos
0
-# photo = recent.first # or very most recent one
0
-# photo.getInfo.url # see its URL,
0
+# photo = recentphotos.first # or very most recent one
0
+# photo.url # see its URL,
0
 # photo.title # title,
0
 # photo.description # and description,
0
 # photo.owner # and its owner.

Comments

    No one has commented yet.