Skip to content

Instantly share code, notes, and snippets.

@the-simian
Created December 16, 2017 04:16
Show Gist options
  • Save the-simian/32ca36824263eb6da52278220ae7dc9b to your computer and use it in GitHub Desktop.
Save the-simian/32ca36824263eb6da52278220ae7dc9b to your computer and use it in GitHub Desktop.
Put your twitter keys in this and run node. DO IT
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