Created
June 26, 2012 13:54
-
-
Save usure/2995904 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
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