Hacker News new | past | comments | ask | show | jobs | submit login
Adventures in Deleting Tweets (johnloeber.com)
83 points by loeber on June 3, 2018 | hide | past | favorite | 23 comments



You don't need all of this. All what you need is to request your data from twitter (Your Tweet archive > https://twitter.com/settings/account). Iterate through the csv file and use tweet_id to unlike, remove or do what you want through their Twitter API.

Source: I have done it before, and it took less time/work than what you have stated.


When you say "all of this", that's only true for the browser-scraping part. You still need to use the API's CreateFavorite and DestroyFavorite calls on old tweets.

(As discussed, purely calling DestroyFavorite won't work on Tweets outside the 3200-tweet-capped API-accessible data store).


It seemed obvious to me that this is what he meant.


With the exception of the data retrieval method, the OP tried this, and suggests that simply having the tweet_id is not enough, if the tweet it corresponds to happens to be old enough (or something) to not be accessible by the API.


I did exactly this a while ago (before deleting my Twitter account for good) and with the id extracted from the downloaded CSV I could delete everything. Perhaps they've changed policies recently.

I wrote a couple of Python scripts to keep your timeline tidy (delete everything from the beginning, then trim and leave only the last N): https://github.com/rinze/obliterate_tweets


Twitter API allows you to get 3200 old tweets. That's not enough to delete all the tweets. If you request your data, you can get all your tweets.

>> tweet_id is not enough

tweet_id is enough to do any interaction if you give read/write to the key that you are using in your Twitter API. I deleted my tweets (back to 2012).


but it doesn't unlike. You have to re-like/un-like it now, too, beyond 3200.


It seems like it should be easy for that API to provide access to take action on tweets beyond the 3200 threshold, by passing it along to a rate-limited task queue. I imagine there’s an incentive to not provide hot access to old activity data due to infrastructure constraints, but if you just responded HTTP 202 and batched them all later, it’d be gentle enough on the colder shards.


But this is Twitter we’re talking about.

The API is a relic of their (much better) past and nobody gives a shit about it anymore. It’s a miracle it still works to be honest.

I wouldn’t be surprised if this limitation was actually a feature part of their quest to piss off and alienate as many developers as possible.


Honestly they were probably too developer-friendly in the past. What other social network gives such comprehensive access via API that you can literally replicate the entire app in a third-party service? I'm not sure why any startup would allow third parties to make an end-run around their entire product.


The real value of a social network is in the people using it - whether they use a third-party client doesn’t change anything in this regard. If anything, having third-parties making free/cheap clients for you is actually a bonus.


It matters if the third-party client decides to show their own ads instead of yours.


Make API access paid. Most of your users would switch to the official clients and see your ads. The few who wouldn’t click on your ads anyway will keep using the third-party client. Everyone ends up happy as a result.


They changed their attitude significantly. The iPhone App Store had been out for nearly three years before they released an official app (via acquiring a third party one), as they just kept telling people to use one of the third party apps. They didn't want to do the work.

https://techcrunch.com/2010/04/09/twitter-acquires-tweetie/


Reddit.

The most popular and best mobile apps are still made by 3rd parties using the API.


Twitter (and their API) is horribly broken and inconsistent.

There is twint [0], which bypasses the API and just scrapes their website to circumvent API limitations.

The wrong number of favorites could be cached and it will go a way after a day or two, or it might be favorites on Tweets you can't see (because you're blocked, or the account is private, or the Tweet/account has been deleted).

As __bee said in another comment, you can request your Tweet archive and get the Tweet IDs from the CSV (I've seen a handful of Tweets of mine that were not in the CSV, but those are very rare). At least for deleting Tweets, there is no rate limit. Twitter also won't show your own Retweets when the original Tweet is no longer visible to you (although they might be included in the CSV) and made it impossible to interact with those. It used to be possible to delete Retweets if you somehow got its ID, but I think this has been disabled as well.

If you want to play around with the API but don't want to register your phone number and an application at Twitter, you can use tools such as the "t" cli [1] or the "twython" library [2] with any of these publicly known API keys [3].

0: https://github.com/haccer/twint

1: https://github.com/sferik/t/

2: https://github.com/ryanmcgrath/twython

3: https://gist.github.com/sokcuri/42fba0b455a7b7b8ab772ba34426...


If you're doing all the browser scraping, wouldn't it have been easier to just automate your browser clicking the delete/unlike button itself? I've done this in the past with Selenium, sometimes needing GreaseMonkey.


You'd still want to collect all the Tweet IDs such that you can archive them (download the JSON blobs).


The Id is easily scraped as well though


If any Mac or iOS developer wants to help create a native app that automates this tedious procedure, I’ll be happy to design it.


I’ve been using Tweet Cleaner for iOS for over a year. Works great.


[dead]


Thank you!


What was the content?




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: