Skip to content

Instantly share code, notes, and snippets.

@Palleas
Created February 5, 2010 20:31
Show Gist options
  • Save Palleas/296194 to your computer and use it in GitHub Desktop.
Save Palleas/296194 to your computer and use it in GitHub Desktop.
require "open-uri"
require "rubygems"
require "nokogiri"
url = 'http://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=palleas&api_key=99a9fb12391886a19391d92709401988&period=7days'
doc = Nokogiri::XML(open(url))
doc.xpath('//topartists/artist/name').each do |artist|
name = artist.content
puts 'Current arist = ' + name
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment