Skip to content

Instantly share code, notes, and snippets.

@benbonnet
Created May 28, 2009 14:04
Show Gist options
  • Save benbonnet/119318 to your computer and use it in GitHub Desktop.
Save benbonnet/119318 to your computer and use it in GitHub Desktop.
@keyword = params[:search][:keyword]
keyword = CGI::escape(@keyword)
api = "xxxxx"
method = "flickr.photos.search"
remote_url = "http://api.flickr.com/services/rest/?method=#{method}&api_key=#{api}&tags=#{keyword}&per_page=20"
@doc = Hpricot.parse(open(remote_url))
render(:update) do |page|
page.replace_html "api_content", :partial => "flickr/search"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment