Skip to content

Commit

Permalink
fixes..
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Jan 17, 2013
1 parent d6bb51f commit 235170a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ gem "sinatra"
gem "haml"
gem "xml-simple"
gem "json"
gem "anyplayer", :git => "git://github.com/sunny/anyplayer.git", :tag => "v0.0.2"
gem "anyplayer", :git => "https://github.com/sunny/anyplayer", :tag => "v0.0.2"
gem "thin"
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GIT
remote: git://github.com/sunny/anyplayer.git
remote: https://github.com/sunny/anyplayer
revision: 30c3f5754a2a862d930761422ea3ac3a269ce8d6
tag: v0.0.2
specs:
Expand Down
5 changes: 3 additions & 2 deletions sonice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
alias_method :h, :escape_html

def artist_image(artist)
last_fm_uri = "http://ws.audioscrobbler.com/2.0/?method=artist.getimages&artist=%s&api_key=b25b959554ed76058ac220b7b2e0a026"
last_fm_uri = "http://ws.audioscrobbler.com/2.0/?method=artist.getimages&artist=%s&api_key=5636ca9fea36d0323a76638385aab1f3"
return unless artist

artist = Rack::Utils.escape(artist)
xml = XmlSimple.xml_in(open(last_fm_uri % artist).read.to_s)
images = xml['images'].first['image']
images = xml['images']
images = images.first['image'] if images
if images
image = images[rand(images.size-1)]["sizes"].first["size"].first
return image['content']
Expand Down

0 comments on commit 235170a

Please sign in to comment.