Skip to content

Instantly share code, notes, and snippets.

@usure
Created June 26, 2012 13:54
Show Gist options
  • Save usure/2995904 to your computer and use it in GitHub Desktop.
Save usure/2995904 to your computer and use it in GitHub Desktop.
require 'isaac'
require 'lastfm'
api_key = "api_keyhere"
api_secret = "api_secret here"
lastfm = Lastfm.new(api_key, api_secret)
token = lastfm.auth.get_token
#puts api_key
#puts token
puts "http://www.last.fm/api/auth/?api_key=#{api_key}&token=#{token}"
sleep 10.0
lastfm.session = lastfm.auth.get_session(token)['key']
configure do |c|
c.nick = "TheMusicBot"
c.realname = "TheShadowFog"
c.server = "irc.awfulnet.org"
c.port = 6667
end
on :connect do
join "#music"
end
on :channel, "!info" do
msg channel, "Created by TheShadowFog"
end
on :channel, "!mu" do
# song = lastfm.user.getRecentTracks('Lupin1112')
# song = lastfm.artist.getInfo('Camera Obscura')
msg channel, song
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment