Keeping the Receipts on Twitter

an AI-generated image of a receipt with the Twitter bird on it
For years I had this frequent frustration where I wanted to reference a tweet, but then after the fact I couldn’t find it to save my life.

To try to make this easier on future me, I started getting in the habit of favoriting every tweet that I remotely thought was interesting. This was nice, but I quickly discovered that it’s actually really difficult to find favorited tweets after the fact, in part because Twitter sorts them by the date the tweets were written, not when you favorited them.

Eventually this became a big enough annoyance that I reminded myself that I can program so I decided “fuck this, I’ll build my own thing.”

But also, like any good developer, I have a keen sense of the amount of effort that goes into making even a seemingly simple app. Also, like any good developer, I’m really lazy.

As such, it was my goal not to try to reinvent everything. I already had an app for cataloging information: DEVONthink. And I trust DEVONthink to handle tagging and shit for the thousands of tweets I’d want to bookmark better than I’d trust anything I can cobble together in my spare time.

So all I had to do was get tweets into a format DEVONthink could index, and I was golden.

Then it came to me: what if I converted tweets into Markdown files? Turns out, Markdown is a great way to represent tweets. You can embed images and videos, and Markdown also has a way to quote blocks of text, which is absolutely perfect for quote tweeting.

So, I built a small app called Receipts. It’s a good mix of being over-engineered and under-engineered, but its purpose is to import tweets and convert them into Markdown files.

Receipts can download entire tweets, including their attached photos and videos. Receipts will also recursively download quoted tweets, as well as all of their attached photos and videos.

Receipts runs on my Mac. I have an app called Hazel watch a Dropbox folder for new files. Whenever I want Receipts to save a tweet, I add a file to this Dropbox folder. The file’s content is simply the URL of the tweet (and if I have a batch of tweet URLs I can stick them all in one file). Hazel will see the new file, tell Receipts to import the tweets, and then move the file to the processed folder.

Making text files and saving them into a Dropbox folder is tedious, so I made a few tools to simplify this.

I already had a massive back catalog of favorited tweets from over the years, so I downloaded my Twitter Archive and grabbed all those tweet URLs to backfill receipts. A lot of old tweets 404ed, but my import script handled that okay. One other interesting issue: Twitter didn’t always natively support images in tweets, so back in the day, services like Twitpic popped up to fill that need. But Twitpic is long gone, so any old tweets I have that had image links to Twitpic were lost to the ages (and, of course, my script doesn’t read media from third party sites… yet).

Initially, my goal was for all my favorited tweets to automatically get catalogued. So I used an IFTTT recipe that would trigger whenever I liked a tweet, and save the tweet URL to my Dropbox folder. This worked well enough, but I ran into some problems with this.

I decided to settle on just explicitly marking tweets I wanted to save to Receipts instead of using favoriting. Now that Twitter notifies the author of the tweet that you favorited it, I actually prefer not having to favorite (especially since I’m not necessarily bookmarking tweets out of admiration).

I made an Alfred workflow that can take a tweet URL from the clipboard and save it to the Dropbox folder.

For my iPhone, I built an iOS Shortcut. It’s set up as a Share action, and it will save a URL to the tweet in a file in a Dropbox folder for you. This iOS shortcut also works on the Mac, but because macOS still doesn’t let you have shortcuts as share actions, I use Sharebot to make it possible to save a Twitter receipt from the Share menu.

At this point, I just need to get them into DEVONthink, which we’ll talk about in a future post.

If you read this and you thought “wow, this sounds like a reasonable, well-designed piece of software and I would like to run this on my own computer,” fork it on GitHub and start playing around with it!

Leave a Reply

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