Earlier this month, you may have seen this thread on Twitter describing a company deploying dystopian tactics (a.k.a. an ill-conceived algorithm) to compile a background check out of this person's liked tweets.
This got me thinking. What purpose do my Twitter likes serve? Do I need them?
...Could I delete them all?
The Purpose of Twitter Likes
First, some history. Pre-2015, Twitter likes were called favorites and were denoted by a ⭐️, not a ❤️. They were initially meant to serve as a way to bookmark tweets (now re-added as a separate half-baked feature). Since then, Twitter realized likes yield far more engagement than favorites and switched. Twitter likes are not bookmarks. It would be difficult to use them that way even if one wanted to.
Today, Twitter likes are simply that. A quick way to say, "I like this tweet." A social exchange—ephemeral in nature, but permanently recorded and published publicly by Twitter.
Why? Perhaps the public list of likes is a vestigial feature, leftover from when likes were favorites were bookmarks. Regardless, given a relatively short period of time, a like is something neither I nor its recipient will reference or care about. I've reached around 66,000 likes, none of which are meaningful beyond the most recent hundred or so.
So Do I Need 'Em?
At least not this many. In my ideal Twitter world, likes last long enough to convey appreciation, then disappear once they've served their purpose. To reach this ideal world, I'd need to write a script that loops through all of my liked tweets and unlikes any beyond the most recent hundred or so.
Can I Delete 'Em?
Short answer, it's possible - but brutal. I am currently at war with Twitter.
First, I gained access to the Twitter API by repeatedly emailing them until they gave it to me.
Then I started hitting roadblocks.
I wrote a Python script that began unliking all of my liked tweets, and it worked beautifully. Until it didn't. After a bit of research, I discovered this Wired piece that described the exact roadblock I'd run into, "We've found that likes outside this 3,200 window can't be removed even if we get details on them from another source." I had reached this limit.
And this quote is only half of the story - it's missing the reason likes can't be removed outside this window. The Twitter API does not recognize likes beyond the most recent 3,200. Once all of the liked tweets within this window are unliked, Twitter sends over an empty list. No way around it. Old likes are 100% inaccessible through the API.
To unlike tweets outside of this window, I'd need to find another way.
And therefore, two scripts would now be necessary:
- One that deletes all of my likes outside the 3,200 window from now until the beginning of time, a.k.a. 2008.
- Another that continuously runs and deletes stale likes over time.
Delete Old Likes
I found a few 3rd-party apps that claim to offer the ability to delete all likes, Circleboom being an example. Suffice it to say, this blog post of theirs is a lie. Their app is unable to see likes beyond the 3,200 window.
After this, I made a shocking discovery. Twitter's own apps are affected by this limit. Whether viewing my liked tweets through Twitter's iOS app or website, likes outside of the 3,200 window aren't displayed as having been liked - the heart icons are empty.
One thing I noticed when interacting with the above UI - in order to remove an old tweet from my likes, I'd need to like it again before unliking it.
This same pattern held true when interacting with likes through the Twitter API. In order to remove one of these likes through the API, I'd need to simulate this like/unlike pattern.
Which I did.
Here's a simplified snippet of that script...
for likeId in likeIds: twitter.like(likeId) twitter.unlike(likeId) print("Liked & unliked " + likeId)
...and the Terminal output when running it.
This, however, has an unfortunate side effect. Every like causes a notification just like any other would despite these being tweets I'd already liked in the past.
And herein lies the dilemma. I can accomplish my goal. But it will spam the tweeps I've liked the most.
A cruel irony indeed.
Do I follow through? At this point, it seems unlikely. I'm only ~6% done. With rate limiting, this would likely be a months-long process. Ugh.
Delete Stale Likes
It's not all bad.
The goal of my second script is to delete likes as soon as they become useless. Therefore, this script only deals with recent likes that exist within the 3,200 window. No problem!
Here's a snippet of this new script:
for i, like in enumerate(likes): if i >= 10: twitter.unlike(like.id)
It boils down to this: It loops through all of my liked tweets (within the window) and unlikes any beyond the first 10. I initially had this script running every 30 minutes but have decreased the frequency to once per day. It's now a nightly cleanup routine.
Another neat feature:
twitter.dm_self("Unliking " + str(len(likes)) + " tweets ✌️")
The script self-reports how many likes it's cleaning up when it runs! This is what I see in my DMs on Twitter.
The dream of deleting all of my Twitter likes may be dead, but I did manage to remove all of them through October 2019 and am down to 61.4K likes. And that number won't be growing - all new likes are being scrubbed daily thanks to an AWS Lambda function.
If you'd like to try it yourself, here's a gist that contains a simplified version of that function. Feel free to post any questions or comments there.
Thanks for reading! 👋