Skip to content

Instantly share code, notes, and snippets.

@jillbert
Created June 19, 2020 17:43
Show Gist options
  • Save jillbert/dae4dbe858fca1c101cda1c2a0cc7a8e to your computer and use it in GitHub Desktop.
Save jillbert/dae4dbe858fca1c101cda1c2a0cc7a8e to your computer and use it in GitHub Desktop.
var Twit = require('twit');
var T = new Twit({
consumer_key: 'Uah0TKkAhngA8nQwGc9M6PgZS',
consumer_secret: '8Nz0kMIe1qXmRV5VROR4pQUEmwGlnO0kFBDXCgW112TsFCzrgT',
access_token: '911107578746122241-DyUJM5sHlydr6acA66dJ15Jy7jVgoq4',
access_token_secret: 'SYyO6zf65dZzzIE18IxjxCS90RKNze8iQu1vfITU9Il12',
})
var stream = T.stream('statuses/filter', { track: ['hey invite', 'hey code', '#hey', 'hey.com'] });
console.log('twitter bot started');
stream.on('tweet', function (tweet) {
match_res = tweet.text.match(/\b[A-z0-9]{7}\b/g)
console.log(tweet.text)
if (match_res != null) {
console.log("IMPORTNAT: " + match_res)
console.log("")
}
console.log("")
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment