Created
March 14, 2011 20:54
-
-
Save jammus/869859 to your computer and use it in GitHub Desktop.
Tweet every song you listen to! Lose followers!
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
var LastFmNode = require("lastfm").LastFmNode, | |
twitter = require("twitter"); | |
var lastfm = new LastFmNode({ | |
api_key: "your_key", | |
secret: "your_secret"}); | |
var twit = new twitter({ | |
consumer_key: 'STATE YOUR NAME', | |
consumer_secret: 'STATE YOUR NAME', | |
access_token_key: 'STATE YOUR NAME', | |
access_token_secret: 'STATE YOUR NAME' | |
}); | |
var stream = lastfm.stream("your_username"); | |
stream.on("scrobbled", function(track) { | |
twit.updateStatus({ status: "I just listened to \"" + track.name \"' }); | |
}); | |
stream.start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Completely untested. In fact, I just spotted a bug.