Skip to content

Instantly share code, notes, and snippets.

@boffbowsh
Created September 10, 2009 12:46
Show Gist options
  • Save boffbowsh/184532 to your computer and use it in GitHub Desktop.
Save boffbowsh/184532 to your computer and use it in GitHub Desktop.
#! /usr/local/bin/ruby
require 'rubygems'
require 'nokogiri'
require 'open-uri'
doc = Nokogiri.XML(open('http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=boffbowsh&api_key=b25b959554ed76058ac220b7b2e0a026').read)
puts "Now Playing: #{doc.css('track[nowplaying=true] artist')[0].content} - #{doc.css('track[nowplaying=true] name')[0].content}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment