├── .gitignore ├── config.sample.js ├── index.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | config.js 2 | *.log 3 | .DS_Store 4 | node_modules/ 5 | haters/ 6 | -------------------------------------------------------------------------------- /config.sample.js: -------------------------------------------------------------------------------- 1 | /* 2 | HEY 3 | 4 | HEY 5 | 6 | BUSTER 7 | 8 | OVER HERE! 9 | 10 | I'm TALKIN TO U 11 | 12 | Rename this file to config.js and fill it out 13 | 14 | K? 15 | 16 | k! 17 | 18 | */ 19 | 20 | module.exports = { 21 | consumer_key: 'get-your-own', 22 | consumer_secret: 'yah-eh', 23 | access_token: 'serious', 24 | access_token_secret: 'just-go-to-https://apps.twitter.com', 25 | }; 26 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const Twit = require('twit'); 2 | 3 | /* 4 | HEY 5 | 6 | YA U 7 | 8 | Rename config.sample.js to config.js 9 | 10 | k 11 | */ 12 | const config = require('./config'); 13 | const T = new Twit(config); 14 | 15 | const niceThingsToSay = [ 16 | 'It\'s Operator Mono! He wrote a little more about his setup at http://WesBos.com/uses', 17 | 'Hey There! Operator Mono is the name of that game http://WesBos.com/uses', 18 | 'Operator Mono! http://WesBos.com/uses', 19 | 'At your service! It\'s operator mono! http://WesBos.com/uses', 20 | 'wait for it................ operator mono! → → → → http://WesBos.com/uses', 21 | 'Hey! check out http://WesBos.com/uses - it\'s Operator Mono', 22 | ]; 23 | 24 | const funEmojis = ['👊','🔥','👍','🎉','💁','🙃','🍕','😎','😘','👏','✌️','👌','👈','👙','🐷','🍟']; 25 | 26 | function buildTweet() { 27 | // get a random emoji 28 | const emoji = funEmojis[Math.floor(Math.random() * funEmojis.length)]; 29 | // get a random sentence 30 | const sentence = niceThingsToSay[Math.floor(Math.random() * niceThingsToSay.length)]; 31 | return `${sentence} ${emoji}`; 32 | } 33 | 34 | const stream = T.stream('statuses/filter', { track: 'wesbos font' }); 35 | 36 | stream.on('tweet', (tweet) => { 37 | 38 | // don't tweet myself 🤦 39 | if (tweet.user.screen_name === 'wesbos') return; 40 | 41 | console.log(tweet); 42 | const createdTweet = { 43 | status: `@${tweet.user.screen_name} ${buildTweet()}`, 44 | in_reply_to_status_id: tweet.id_str 45 | }; 46 | T.post('statuses/update', createdTweet, (err, response) => { 47 | console.log(response); 48 | }); 49 | }); 50 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wesbot", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node index.js" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "twit": "^2.2.4" 13 | } 14 | } 15 | --------------------------------------------------------------------------------