Skip to content

Instantly share code, notes, and snippets.

@jammus
Created March 14, 2011 20:54
Show Gist options
  • Save jammus/869859 to your computer and use it in GitHub Desktop.
Save jammus/869859 to your computer and use it in GitHub Desktop.
Tweet every song you listen to! Lose followers!
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();
@jammus
Copy link
Author

jammus commented Mar 14, 2011

Completely untested. In fact, I just spotted a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment