Skip to content

Instantly share code, notes, and snippets.

@sholden
Created January 29, 2009 20:54
Show Gist options
  • Save sholden/54736 to your computer and use it in GitHub Desktop.
Save sholden/54736 to your computer and use it in GitHub Desktop.
require 'hpricot'
require 'open-uri'
class PhotosController < ApplicationController
IMAGE_SRC = 'http://picasaweb.google.com/data/feed/api/user/kevinherschman?kind=album&access=public'
def index
doc = Hpricot(open(IMAGE_SRC))
@image_info = (doc/"entry").map do |entry|
{
:title => (entry/"media:title").first.inner_text,
:url => (entry/"media:content").first[:url],
:thumbnail => (entry/"media:thumbnail").first[:url]
}
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment