How to Browse and Search your Liked Tweets

Have you ever tried to find a tweet you liked some time ago? Me too, and it’s almost impossible. Scrolling down in the ‘Likes’ tab of my profile while doing CMD-F is a pain and it doesn’t even work sometimes.

I came up with a way of saving all my past and future Twitter likes. It lets me browse, filter them and search for tweets by text or user. And it’s free.

I thought it could be helpful for others, so here it goes

Image for post
Image for post
Scrolling for ages to find that like from 3 months ago… Never again!!

Saving all your past Twitter likes

If you’re only interested in keeping an archive of your future Twitter likes, you can skip this part and jump to the last section.

Step 1: Downloading your Twitter archive

Go to https://twitter.com/settings/your_twitter_data, enter your password and then click on ‘Download Archive’. It will take some minutes and you’ll get then an email when they’re ready.

Image for post
Image for post

Download them and you’ll get a .zip with a bunch of .js files. The only one you’ll need is like.js

Image for post
Image for post

Step 2: parsing that file and getting the full info for each tweet

To do so, I made a small python project. You can clone it from https://github.com/xoelop/get-twitter-likes.

Then, go to where you’ve cloned the repo in your computer and copy your like.js file into the data folder.

The main script in the project is get_likes_to_csv.py . Running it parses like.js, connects to the Twitter API to download the full info for each tweet and then saves it to a CSV file.

To be able to use it, you’ll need to

  1. Register a new Twitter app here to get the access tokens necessary to interact with the Twitter API
  2. Create a file called .env in the root folder, whereget_likes_to_csv.py is, and fill it with your Twitter credentials
TWITTER_CONSUMER_KEY=...
TWITTER_CONSUMER_SECRET=...
TWITTER_ACCESS_TOKEN=...
TWITTER_ACCESS_TOKEN_SECRET=...

3. Install pipenv if you don’t have it, doing pip install pipenv

4. And finally, run pipenv run python get_likes_to_csv.py

Image for post
Image for post

I had about 6k liked tweets and it took about 1 minute. Then, you’ll have a CSV file with all the details for all your liked tweets in data

Finally: having all your liked tweets saved in the cloud

You could use Airtable (ref link) or any other service you want. I loove Airtable, it lets you create multiple views for the same table, filter, group values in a much nicer way than Google Sheets.

But the row limit per base in the free plan is only 1200, while it’s 5 millions in Google Sheets. So I used Google Sheets, it’s good enough for now.

To do it, go to sheets.new to create a new spreadsheet on Google Sheets. Then, click on File > Import > Upload and drag there the CSV you’ve just created

Image for post
Image for post
Done! There are all the tweets I’ve liked so far

Saving all your new Twitter likes

To do this, I created an Integromat scenario that fetches my most recent likes and adds them to this spreadsheet.

Image for post
Image for post

For those that don’t know it, Integromat is a product that lets you connect hundreds of apps together without coding. It’s like Zapier on steroids. Their free tier includes 1000 free operations per month, which is a lot and probably enough to run this.

If you don’t have an account, sign up here first. Note: it’s a referral link, but it’s free and, if you upgraded to a paid account, it wouldn’t cost you more :)

This scenario has just 3 modules: the first one to get the IDs of the last liked tweets, the middle one to get detailed information for each tweet, and the last one to create new rows in Google Sheets

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Even easier

If you don’t wanna set it all up by yourself, you can just clone this scenario. Integromat doesn’t let users share scenarios with a link yet, but you can import and export scenarios.

So I exported mine and uploaded to this Github repo.

To clone it, download this json. Then, go to integromat.com, click on ‘Create new scenario’. Don’t select any module, and in the next screen click on the ... button, and then on Import Blueprint. Select the JSON file you’ve just downloaded, and the scenario will be almost ready

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

The last thing you’ll have to do it adding your Twitter and Google accounts so that Integromat can connect to them. To do so, click on each one of the modules, click on Add to add the connections if you haven’t before.

Image for post
Image for post

And finally, if you want your scenario to run periodically, make sure to set up and turn on scheduling, on the bottom left corner

That’s it

Let me know if something isn’t clear or you need help setting it up. And if you found this interesting, follow me on Twitter!

Cheers!

Written by

Freelance data scientist and software developer. On Twitter: @xoelipedes.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store