Created
December 16, 2017 04:16
-
-
Save the-simian/32ca36824263eb6da52278220ae7dc9b to your computer and use it in GitHub Desktop.
Put your twitter keys in this and run node. DO IT
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 Twitter = require('twitter'); | |
var client = new Twitter({ | |
consumer_key: '', | |
consumer_secret: '', | |
access_token_key: '', | |
access_token_secret: '' | |
}); | |
var stream = client.stream('statuses/filter', {track: 'Garth Brooks'}); | |
stream.on('data', function(event) { | |
let sn = event.user.screen_name; | |
client.post('statuses/update', {status: ` | |
Hey, @${sn} | |
When I think of things I wanna post, | |
I wanna post cool stuff, slick stuff, neat stuff | |
but mostly its just gonna be raw` }, function(error, tweet, response) { | |
if(error) throw error; | |
}); | |
}); | |
stream.on('error', function(error) { | |
console.log(error) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment