Skip to content

Instantly share code, notes, and snippets.

@ollybritton
Created August 8, 2016 07:07
Show Gist options
  • Save ollybritton/c611d40b71685a03a816858582af7741 to your computer and use it in GitHub Desktop.
Save ollybritton/c611d40b71685a03a816858582af7741 to your computer and use it in GitHub Desktop.
const Twit = require('twit');
const config = require('./config');
const T = new Twit(config);
const badThingsToSay = [
'What font do you use?',
'Hello, whats the name of the font you use font?',
'Hey Wes, what\'s the name of that weird font you use?',
'Weird font that you use. Mind telling me what it\'s called?',
'What is the name of the font you use................ I\'ve never seen it before...',
'Dat font dou. Just watched a couple of tutorials and saw what font you have. What\'s it called???????.',
];
const badEmojis = ['πŸ‘ŠπŸ˜²', 'πŸ”₯🏠', 'πŸ‘πŸŒ΅', 'πŸŽ‰πŸ˜‘', 'πŸ’πŸ’Š', 'πŸ™ƒβ›', 'πŸ•πŸ˜­', 'πŸ˜Žβ›ˆ', '😘🐐', 'πŸ‘πŸŒͺ', '✌️🎬', 'πŸ‘ŒπŸ˜·', 'πŸ‘ˆπŸ‘Ή', 'πŸ‘™πŸ˜€', 'πŸ·πŸ”', '🍟😳'];
function buildTweet() {
// get a random emoji
const emoji = badEmojis[Math.floor(Math.random() * badEmojis.length)];
// get a random sentence
const sentence = badThingsToSay[Math.floor(Math.random() * badThingsToSay.length)];
return `${sentence} ${emoji}`;
}
const stream = T.stream('statuses/filter', { track: 'llimpingllama font' });
stream.on('tweet', (tweet) => {
console.log(tweet);
const createdTweet = {
status: `@${tweet.user.screen_name} ${buildTweet()}`,
in_reply_to_status_id: tweet.id_str
};
T.post('statuses/update', createdTweet, (err, response) => {
console.log(response);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment