public
Description: Simple gem to fetch photos from Flickr's REST API
Homepage: http://www.estadobeta.com
Clone URL: git://github.com/ismasan/mini_flickr.git
Search Repo:
Added info on MiniFlickr::Simple to README
ismasan (author)
Thu May 15 05:30:11 -0700 2008
commit  1c13528fa7faf92186ad48a2d5eaec3f7d8db572
tree    a65aa06fef64b8415a6ab4a0b4d3f8872b974164
parent  6924f792ef97826a118ebabddcdcb8e72faf052a
...
18
19
20
 
 
21
22
23
...
31
32
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
35
36
...
18
19
20
21
22
23
24
25
...
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
0
@@ -18,6 +18,8 @@ Get your Flickr user id at http://idgettr.com/
0
 
0
 == SYNOPSIS:
0
 
0
+=== Class level configuration
0
+
0
   class MyFlickr
0
     include MiniFlickr::Base
0
     connect_to_flickr :api_key => 'your-api-key', :user_id => 'your-user-id'
0
@@ -31,6 +33,27 @@ Get your Flickr user id at http://idgettr.com/
0
   </a>
0
   <% end %>
0
 
0
+=== Instance level configuration
0
+
0
+There's also a utility class that takes api_key and user_id as parameters.
0
+This means you can configure Flickr accounts per-instance (for example your site has many users, each with their own Flickr photos).
0
+
0
+flickr = MiniFlickr::Simple.new('some-key', 'some-user-id')
0
+
0
+flickr.photos # => collection of MiniFlickr::Photo objects with sizes and url's (see above)
0
+
0
+You can also use this as a value object for ActiveRecord, for example.
0
+
0
+class Flickr < MiniFlickr::Simple; end
0
+
0
+class User < ActiveRecord::Base
0
+ composed_of :flickr, :mappings => %w(api_key flickr_user_id)
0
+end
0
+
0
+user = User.create(:name => 'Ismael', :api_key => 'some-api-key', :flickr_user_id => 'some-flickr-userid')
0
+
0
+user.flickr.photos # collection of flickr photos
0
+
0
 == TESTING:
0
 
0
 This gem uses Rspec for testing. Run the existing specs with rake spec.

Comments

    No one has commented yet.