diff --git a/app.js b/app.js index 0e8e55e..a062dc6 100644 --- a/app.js +++ b/app.js @@ -15,7 +15,7 @@ var T = new Twit({ // filter the public stream by english tweets containing `#apple` // -var stream = T.stream('statuses/filter', { follow: '25073877, 1339835893, 179932936, 172933437' }) +var stream = T.stream('statuses/filter', { follow: '25073877, 31176345' }) stream.on('tweet', function (tweet) { if (tweet.user.screen_name === 'realDonaldTrump') { var b64content = fs.readFileSync('./pics/trump.gif', { encoding: 'base64' }) @@ -43,10 +43,10 @@ T.post('media/upload', { media_data: b64content }, function (err, data, response }) }) } - if (tweet.user.screen_name === 'HillaryClinton') { - var b64content = fs.readFileSync('./pics/hillary.gif', { encoding: 'base64' }) - var hillarymessages = session.object.hillarymessages; - var randomhillarymessage = hillarymessages[Math.floor(Math.random() * hillarymessages.length)]; + if (tweet.user.screen_name === 'blues_traveler') { + var b64content = fs.readFileSync('./pics/popper.gif', { encoding: 'base64' }) + var poppermessages = session.object.poppermessages; + var randompoppermessage = poppermessages[Math.floor(Math.random() * poppermessages.length)]; // first we must post the media to Twitter T.post('media/upload', { media_data: b64content }, function (err, data, response) { // now we can assign alt text to the media, for use by screen readers and @@ -60,10 +60,10 @@ T.post('media/upload', { media_data: b64content }, function (err, data, response T.post('media/metadata/create', meta_params, function (err, data, response) { if (!err) { // now we can reference the media and post a tweet (media will attach to the tweet) - var params = {in_reply_to_status_id: nameID, status: '@' + name + " " + randomhillarymessage, media_ids: [mediaIdStr] } + var params = {in_reply_to_status_id: nameID, status: '@' + name + " " + randompoppermessage, media_ids: [mediaIdStr] } T.post('statuses/update', params, function (err, data, response) { - console.log("Replied to Hillary's Tweet with " + randomhillarymessage) + console.log("Replied to Pooper's Tweet with " + randompoppermessage) }) } })