Twitter Bot / Wk 3 & 4 / A Bot that Responds

MIDDAY TRAIN
The idea for “Midday Train” was inspired by the story behind Gladys Knight and the Pips’s “Midnight Train to Georgia“. The writer, Jim Weatherly originally titled the song “Midnight Plane to Houston” after a conversation with Farrah Fawcett (who was dating his friend, Lee Majors) about taking a midnight plane to Houston and visit family. It was later changed to “Midnight Train to Georgia” for Cissy Houston and was later sung by Gladys Knight. My original plan was to list of all the towns and cities in the United States and not just the major cities, so a person can imagine taking a train to all these places during the day, preferably during the 9-5 work hours. I eventually will gather that list of all the cities and towns, but for now I just used Darius Kazemi’s JSON file on US Cities.

As for adding the responsiveness to this bot, some parts work, but others don’t and I’m still in the midst of debugging my error codes like “ReferenceError: followerHandle is not defined”. I also intend to vary the statements more.

UPDATE:
With an extra week to work on this project and Allison’s ‘rollDice‘ in-class tutorial from last week and the simple chatbot example code on GitHub, I was able to randomize the initial tweets more and debug the code for better responsiveness when a user likes, direct messages and retweets. And I learned to use GitHub with a lot of help from a tutor, so the sample code for this bot is available online.

 

(Initial Tweet)

(Response after a user “likes” the twitter entry)

(Response after a user replies to a twitter entry)

(Response after a user follows the bot, but when I tried to change it to a different statement, like “You are welcome to come along,” the user name became “undefined” and the link to the user stopped working)

 

SOURCE CODE: