The Make America Tweet Again Project

The Make America Tweet Again Program

Notes on the Twitter Ecosystem, Making A Tutorial, and Implementation

@realDonbotTrump profile page.
@realDonbotTrump

Recently I decided to make a Twitter Bot in the style of Donald Trump.  I think I learned a lot in the process about programming and the Social Media platform itself.  If you are interested in recreating the project yourself, you can find the source code for Make America Tweet Again on Github, or start on Part 1 of Make America Tweet again here on JoeDevelops.com

The Tutorial guides users through the process of using the Tweepy API to collect Twitter data on users and storing it for later use and analysis.  It then looks into random text generation with use of Markov Chains and touches on class creation and inheritance.  Finally, it looks into using the Tweepy API again to post data to Twitter and how to schedule time-dependent tasks.


Links


The Strange World of Twitter

I have never really used Twitter before.  I use Facebook, but it is mostly a way for me to see what’s going on with family and friends blended with a news feed.  Making this bot opened my eyes to a lot of the content that’s on this platform.

Screen Shot 2016-09-06 at 10.10.11 AM
Followers of @realDonbotTrump

My guess is that Twitter is flooded with bots of all kinds.  Because the API is so easy to use and set up, people can set up all kinds of marketing accounts for various reasons.  I suspect that most of the active users are in fact software.  Because of the Trump theme and election activity, I noticed a lot of people began following me.

Many of these accounts have identical or similar background pictures and seem to only exist to tweet and retweet about one topic.  In this case, I attracted a lot of Trump supporters.

Twitter is also a fast paced echo chamber.  Because of this, I got some strange likes and retweets.  While I can’t say exactly why certain people like or retweet what content, I wonder about their intentions.  Are people liking what the bot tweets because they think it’s funny?  Are there people out there who think this is a genuine account, and like any tweet that is hostile toward Hillary Clinton?  Are people retweeting or liking content before they actually fully understand who is tweeting and the nature of what they’re saying?  Twitter makes it really hard to tell.

Screen Shot 2016-09-06 at 10.19.11 AM
A Tweet by @realDonbotTrump retweeted and liked by Twitter-land. Did they think it was Donald Trump? Did they think it was real content? Very hard to say…

Tutorial Building

This was my first real attempt at making content for other’s to read.  While it was fun, it took a very long time.  It took a lot of effort to make sure I was explaining everything fully and clearly.  It was well worth the effort though once I started to get genuine comments and feedback.  Reddit was a good venue to expose these to a wider audience, and I definitely recommend those wanting to start creating content for niche communities to explore this option.

A sample of spam comments I received on WordPress
Spam Comments.

One thing I didn’t expect is to get so much comment spam.  I suppose as somebody who is explaining how to automate bots on the internet, I reap what I sow.


Implementation

This project allowed me to briefly explore a lot of interesting modules.  I’ve never used the Tweepy library before and found it very easy and intuitive to work with.  Tweepy is probably the easiest Twitter Client that I’ve ever worked with.  I was also pleasantly surprised with APScheduler.  I can definitely see this coming back to aid me in future projects if I have time-dependent tasks to run.

The output generated by my program is definitely convincing at times, but it leaves more to be desired in terms of formatting and cleaning up missing punctuation and other small errors.  That being said, if I were to do this project again I would use one of the many libraries that exist to generate random content from source content.  However, I’m glad I tried my hand at doing this from scratch.  I hope the readers enjoyed the experience as well.


Thanks for Reading

If you want to share some things that you found enlightening or confusing, future topics you’d like me to explore, or interesting content your program created, please comment below.

@realDonbotTrump Tweet
@realDonbotTrump Tweet

Leave a Reply

Your email address will not be published. Required fields are marked *