Skip to content

Instantly share code, notes, and snippets.

View julianhofmann's full-sized avatar

Julian Hofmann julianhofmann

  • Würzburg
View GitHub Profile
@julianhofmann
julianhofmann / twitter-remove-tweets.js
Last active September 6, 2023 15:40 — forked from antlionguard/twitter-remove-tweets.js
With this script, you can remove tweets you have tweeted on Twitter. Has been running in search for "(from:{YOUR_TWITTER_NICKNAME}) until:2022-09-01" on 2023-09-06. Don't forget add your nickname to line 9. (The script begins 60 seconds after pasting the code.)
const timer = ms => new Promise(res => setTimeout(res, ms));
setInterval(async () =>
{
// Get all tweets
const allTweets = document.querySelectorAll('.css-1dbjc4n.r-18u37iz.r-1wbh5a2.r-13hce6t');
// Filter tweets
const filteredTweets = Array.prototype.slice.call(allTweets).filter(x => x.innerText.startsWith('@{YOUR_TWITTER_NICKNAME}'));