top | item 17214711

Adventures in Deleting Tweets

83 points| loeber | 7 years ago |johnloeber.com

23 comments

order
[+] __bee|7 years ago|reply
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.

[+] loeber|7 years ago|reply
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).

[+] kelnos|7 years ago|reply
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.
[+] beager|7 years ago|reply
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.
[+] Rjevski|7 years ago|reply
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.

[+] _jomo|7 years ago|reply
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...

[+] foodstances|7 years ago|reply
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.
[+] loeber|7 years ago|reply
You'd still want to collect all the Tweet IDs such that you can archive them (download the JSON blobs).
[+] rakic|7 years ago|reply
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.
[+] ryanmerket|7 years ago|reply
I’ve been using Tweet Cleaner for iOS for over a year. Works great.