Skip to content

Instantly share code, notes, and snippets.

@arches
Created March 5, 2011 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arches/856089 to your computer and use it in GitHub Desktop.
Save arches/856089 to your computer and use it in GitHub Desktop.
console output showing unified access to multiple 3rd-party services. In the output, we see my personal albums/images from these services.
>> albums = Album.find(user, {:services => [:flickr, :facebook]})
=> [#<Buffet::Album:0x1024deee8 @remote_id="72157625131396492", @title="set2", @service="flickr">,
#<Buffet::Album:0x1024df1e0 @remote_id="72157625006674119", @title="set1", @service="flickr">,
#<Buffet::Album:0x1024deec0 @title="Photostream", @service="flickr">,
#<Buffet::Album:0x1024d4330 @remote_id="505294201356", @title="Christmas 2010", @service="facebook">,
#<Buffet::Album:0x1024d4380 @remote_id="504864193096", @title="Profile Pictures", @service="facebook">,
#<Buffet::Album:0x1024d4358 @remote_id="504697162826", @title="A Retrospective", @service="facebook">,
.
.
.
#<Buffet::Album:0x1024d4308 @remote_id="504465347386", @title="Wall Photos", @service="facebook">]
>> albums[2].images.each {|img| puts img.url}
http://farm6.static.flickr.com/5041/5373471837_40cc2a80e0.jpg
http://farm6.static.flickr.com/5169/5373471169_bf63b1fcb3.jpg
http://farm5.static.flickr.com/4098/4859258500_94e17c2c32.jpg
http://farm5.static.flickr.com/4079/4858635611_830eda8f0c.jpg
.
.
.
http://farm5.static.flickr.com/4114/4859247432_7319a54220.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment