How To Give Yourself A Twitterenema

Friday, May 16, 2014 at 12:17 am


Watching unwieldy conglomerates on Twitter is like witnessing an elephant being harassed by a swarm of flies. Twitter belongs to the masses, and when Grocter-OmniLever, Inc. serves up one of its marketing droids to be sacrificed on the altar of consumer discontent, it’s satisfyingly messy — but also, more of a distraction than a solution. Case in point: Due to consumer harassment on Twitter, some chemical — Brominated Vegetable Oil (BVO) — will no longer be used by the soda overlords. I have no opinion on this, as I do not drink soda.

Twitter is also about the now — breaking news, current events, the rumor mill, the water cooler… So, really, I see no point in having my old tweets linger around. Perhaps there’s an epic moment or two worth saving, but, by and large, my tweets are just me blathering whatever rolls off my frontal lobes. Twitter doesn’t even make it easy to revisit history — unless I’ve missed something, you have to scroll, scroll, scroll, scroll, infinitely. Or get lucky with a search keyword.

Twitter also provides no bulk-deletion interface. Why? Because they want that data in their server. Though it provides little-to-no value to you, it’s Twitter’s retirement fund: It is food for targeted ads. I might shrug it off if they actually allowed me a way to search in a targeted manner — instead they redirect me to the timelime; to the now.

They do, however, permit you to download an archive:


This was not without effort: I clicked the button to request the archive, and it told me it was too busy. After two days  of it being “busy,” it finally deigned to give me my data. Their offline browsing design is nice. I had some fun reading old tweets, then I started deleting them. One by one.

After a few hundred tweets, ennui set in. I don’t mean all at once, either: I’d do batches here and there. It was actually sort of fun, at first, to re-read what was on my mind a few years ago… but, like Twitter, I prefer the now. I grew irritated at the wasted time, and decided to automate it.


This is not really a problem I cared to solve in an elegant matter; I simply wanted to get ‘er done. Rather than trifle with the API and auth keys, I just flicked up firebug, clicked “persist,” and then deleted a tweet. This captured the precise little bee waltz of ones and zereos that resulted in a deleted tweet. Firebug will helpfully spit it out as a cURL string: A command line argument that will, essentially, perform the same little bee waltz.


Most of this data is very temporary — as soon as you click “logout,” you’ll get a totally different _twitter_sess — or whatever. Fortunately, I didn’t need it for very long…. just long enough to fire up Cygwin and bash out a rather underendowed shell script. I replaced the number of the target tweet with an argument variable.


I tested it out, and indeed: I could now delete tweets from the command line — until the session expired. As Twitter’s archive provides Comma-Separated Value, I did as you do with CSV and POSIX and BASH:


This is an absolutely terrible shell script, and I do not recommend it at all. Nonetheless, by the time I finished cleaning my bathroom, I’d lost over 1,000 tweets — now that’s multitasking!


  • Breaks as soon as you log out.
  • Does not unretweet retweets.
  • Fails on tweets with line breaks.
  • Probably in violation of Twitter’s Terms of Service.


Bottom line: It doesn’t have to be perfect or permanent, it just has to get the job done.


Categories: software, Uncategorized

Post a Comment