Best Support Ticket Ever Claiming Twitter’s API Is Pulling Tweets From The Future

With alerts set up for certain keywords and phrases – and one searching for “Twitter API” issues, there are interesting results from time to time. And man, did it surface the BEST support ticket ever today.

There’s really no good way to summarize it, so you’ll find it in full below. Thank you for this, @timebot. Thank you.

From the bug report ticket titled “Twitter API returning results that do not respect arrow of time,” we share the best Twitter API support ticket ever:

This will take some explaining.

It started as an afternoon hacking project with your Twitter API. I was inspired to make it when one of my new followers reposted something I’d said months ago. This happens from time to time and it always makes me feel vaguely vertiginous. Twitter is meant to be about the “now” and these intrusions from the past are like being at a family reunion and some aunt asks you how the girl you were dating in high school is doing.

As a learning project/prank, I decided to impose that feeling on my friends. The idea is simple: I made a Twitter bot that scrapes their twitter feeds. It picks some of those tweets—at random—and stores them. It holds them for 3 weeks to 6 months and then it posts them, being sure to mention the original author’s @name.

I called it @timebot. I set it running just over a year ago.

For the first few weeks it sat silently, scraping. When it finally did start tweeting, I couldn’t have asked for a better reaction. At first, no one really noticed, though Sandra blocked it as spam. Then, through some stroke of luck and/or a bug in my random number generator, it retweeted James three times in a row.

“Looks like I’ve got a new stalker. What’s up with @timebot? #annoying” he said.

“@jamesisbest Whoa! Look at @timebot’s timeline. It’s only retweeting us! #weird #stalkerbot” said Samantha.

“@SamanthaTom @jamesisbest WTF. This SUPER CREEPY #stalkerbot” said Allison.

At this point, I fessed up. We all had a good laugh, and it was generally agreed that we should keep @timebot around as a mascot for our little group. Only those who were “in” would get followed by @timebot.

That was that, until James noticed a problem.

“Yo @carzymoney,” he said, “I think @timebot’s got a bug in the link code. #learn2code”

It was a post by Allison. Nothing special, something like “Mmmm tasty lunch” with an image attached. The image was a broken link. No big deal. I tried to find the original tweet but there was some problem with the unique ID and you don’t make it easy to page through past tweets. I’d have given up if I hadn’t noticed the timestamp.

The timestamp was in the future. Two days in the future. Weird bug. But @timebot was always a side project and I was on some big deadlines.

Two days later, Allison decided to go to our favourite sandwich shop. I don’t know the details of what happened. But I do know that at 12:23:51pm on October 3rd, @allililly tweeted “Mmmm tasty lunch” with an image attached and no broken link. The timestamp matched. The unique ID matched. The formerly broken link in @timebot’s message now worked. I got that vertiginous feeling again.

To keep things simple, I’ll spare you the details of the next occurences, or of the time an errant tweet nearly broke up Sandra and her girlfriend. Let’s just say that I’m convinced that, somehow, @timebot is pulling not only tweets from the past, but tweets from the future.

After a thorough review, I can point to the spot in my code where a bad calculation expanded the scope of the search to days after today’s date, but I cannot tell you how it’s possible that the thing returns results. The fault there lies with your API. James thinks it’s because all our tweets are being stored by the Library of Congress. He says the information density of that place warps space and time. I say he’s crazy.