Using and Abusing Twitter's API

2018-03-05 | Technology | Stupid Tricks

Twitter is fascinating. On one hand, you have an endless stream of self-curated news that can be incredibly informative for both work and play. On the other hand, there’s abuse, harassment, and “fake news.” It’s quite fascinating to have easy access to the best and worst of humanity, in real time, and without moving an inch.

So what’s an arm-chair sociologist with programming chops to do on a long weekend, like last year’s 4th of July? Write some code to show him what tweet from a given account was retweeted the most? Nah, that’s way too geeky. Dude should be out in nature, or watching his neighbors light off fireworks in the middle of the infamous Haight Street right in front of a bar called Molotov’s.

Oh wait. No, I did exactly that.

At the time, I was fascinated by the @congressedits twitter account. For those that aren’t familiar, that’s a bot account that tweets out any anonymous Wikipedia edit that comes from a US congress IP address. Most edits traditionally were about the various congresspeople, their districts, and so on and so forth. Most were boring. Here’s an example:

But occasionally, a “juicy” edit would happen, whether it was a politically motivated edit:

or just a bizarre article coming from Congress like:

or

In all cases, the retweet count would vary based on its entertainment value or political malice. So I got curious about what got retweeted the most. I wrote some python code to talk to the Twitter REST API, badda boom, badda bing, I got the results.

At the time, the most retweeted edit was

where someone had added Donald Trump to the list of obstruction cases. This was followed closely by a discussion on Garfield the cat’s gender identity.

Alas, all good thing had to come to an end. At some point, a Hill staffer decided to troll the account and started making random edits from various offices to extremely odd pages like:

and

And so now, the most retweeted @congressedits tweet is:

But that’s not what I’ll leave you with to ponder the most. Our president is, of course, a huge tweeter. What’s his most retweeted tweet?

Click through, watch the video, and ponder the implications.

Copyright © Jim Sam