Created
May 28, 2009 14:02
-
-
Save benbonnet/119315 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################# | |
# VENUE SEARCH => http://www.lastfm.fr/api/show?service=396 # | |
# TRACK SEARCH => http://www.lastfm.fr/api/show?service=286 # | |
# ARTIST SEARCH => http://www.lastfm.fr/api/show?service=272 # | |
# ALBUM SEARCH => http://www.lastfm.fr/api/show?service=357 # | |
################################################################# | |
@keyword = params[:search][:keyword] | |
keyword = CGI::escape(@keyword) | |
api = "xxxxx" | |
method = "artist.search" | |
@url = "http://ws.audioscrobbler.com/2.0/?method=#{method}&artist=#{keyword}&api_key=#{api}" | |
@doc = Hpricot.parse(open(@url)) | |
render(:update) do |page| | |
page.replace_html "api_content", :partial => "lastfm/search" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment