{"id":23430126,"url":"https://github.com/softplus/detweet","last_synced_at":"2025-10-28T09:47:27.510Z","repository":{"id":214978018,"uuid":"736637318","full_name":"softplus/detweet","owner":"softplus","description":"Remove Tweets via Puppeteer","archived":false,"fork":false,"pushed_at":"2025-04-15T16:19:47.000Z","size":148,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T09:47:23.450Z","etag":null,"topics":["nodejs","puppeteer","twitter","twitter-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/softplus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-28T12:55:11.000Z","updated_at":"2025-04-15T16:19:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"2df2467c-0ad7-4d9b-9b7e-8fd705f53704","html_url":"https://github.com/softplus/detweet","commit_stats":null,"previous_names":["softplus/detweet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/softplus/detweet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softplus%2Fdetweet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softplus%2Fdetweet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softplus%2Fdetweet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softplus%2Fdetweet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softplus","download_url":"https://codeload.github.com/softplus/detweet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softplus%2Fdetweet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281418068,"owners_count":26497723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nodejs","puppeteer","twitter","twitter-api"],"created_at":"2024-12-23T08:15:49.440Z","updated_at":"2025-10-28T09:47:27.435Z","avatar_url":"https://github.com/softplus.png","language":"JavaScript","readme":"# detweet\n\nRemove Tweets via Puppeteer - using the Google Chrome browser.\n\nThe Twitter API only supports 50 delete operations per day.\nHow do you delete 20k tweets? Automation.\nIs it 'X' now? Yes, it's 'X' now.\n\n(c) 2023-2024 John Mueller, MIT Licensed.\nhttps://github.com/softplus/ \u0026 https://johnmu.com\n\nUses [Node](https://nodejs.org/) \u0026 [Puppeteer](https://pptr.dev/), which runs Chrome.\nTested on Ubuntu. You need to install Node beforehand.\nLikely to work on other platforms, but I didn't test.\n\n## Initial setup\n\n```bash\n# Grab repo\ngit clone https://github.com/softplus/detweet\ncd detweet\n\n# Get Puppeteer \u0026 fs (filesystem) Node libraries\nnpm init\nnpm install puppeteer\nnpm install fs\n```\n\n### Get updates\n\n```bash\n# get repo \u0026 update npms\ngit pull\nnpm update\n```\n\n## Run\n\n1. Get list of tweets (see below)\n\nPut the list of tweet URLs into `data/tweets_delete.csv` (just a list of URLS for your account; these can be on twitter.com or x.com)\n\n2. Clean up temporary files: delete `data/_counter.csv`, empty `data/_errors/`\n\n3. Run first time:\n\n```bash\nnode detweet.js\n```\n\nThis will open a browser window and navigate to Twitter.\nYou need to log in for it to continue.\n\n4. Log in to Twitter in Browser window\n\n5. Subsequent runs don't need to log in to Twitter.\n\nThe browser window will remain open and show what's happening.\nThis code does not copy \u0026 take your Twitter data, though theoretically it could.\nDon't run random code that accesses your Twitter account.\nShould you run this? Don't trust me, ideally look at the code.\nSorry that I can't be more reassuring.\n\nSet your Twitter account to English.\nThis script uses text on the UI to understand what's happening.\n\nYou can break at any time (ctrl-C).\nIt keeps track of the index within your `tweets_delete.csv` file and starts at the last entry.\nIt processes up to 5000 tweets and then exists.\n\nWhen it encounters a tweet already deleted, it just continues.\nIt looks for the UI text, so if your Twitter account has a non-English language, this might not work :-).\n\n## Like \u0026 Subscribe\n\nSorry.\n\nIf you want to delete \u003e3000 tweets, get a Twitter subscription.\nWithout a subscription, you'll get rate-limited on a daily basis after 3000 tweets or so, it's annoying.\nSorry. Still better than 50/day, right?\n\nWhen rate-limiting triggers, it goes into a backoff mode, retrying every 30 minutes.\nThis won't help if you want to delete many tweets.\n\nGood luck.\n\n## Getting a list of Tweets\n\nYou can get a list of your tweets by requesting a data-dump and then extracting the tweets from there.\n\n1. Request a data-dump from Twitter: https://help.twitter.com/en/managing-your-account/how-to-download-your-x-archive\n\n2. When it's ready, download the zip file and extract it.\n\n3. Copy the files to your Google Drive\n\n4. Run this Google Colab: https://github.com/softplus/detweet/blob/main/tweets_to_csv.ipynb \n\n5. Take the `tweets.csv` file and import it into Google Sheets\n\n6. Go through the list, pick the ones you want to keep, etc.\n\n7. Take the list of Twitter URLs that you want to delete and save them into `data/tweets_delete.csv`.\nNote the CSV files used are just normal text files containing a list of URLs, one per line.\nNo CSV header is needed.\n\n8. Run the script as above.\n\n## Questions?\n\nI probably can't help much, but you can try to reach me on social: https://johnmu.com/+\n\n\nQ: But why?\n\nA: I wanted to delete my tweets, but I had \u003e20k tweets, so I couldn't use the Twitter API.\n\n\nQ: Why not use the Twitter API?\n\nA: It only allows 50 delete operations per day. That would take a while.\nThe code here processes about 400 in an hour.\nIt could be sped up by tweaking the delays, but you don't have to watch it, so it's fine.\n\n\nQ: Why can't it delete all retweets?\n\nA: Retweets / reposts from somewhere in 2018 until before mid-September 2022 are not deletable for some unknown reason. IDK. Maybe the API can do it? I have 1000s of these, so the API doesn't really help there.\n\n\nQ: Can I use proxies to get around the rate limiting?\n\nA: The rate limiting appears to be on a per-account basis, so no, proxies won't help.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftplus%2Fdetweet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftplus%2Fdetweet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftplus%2Fdetweet/lists"}