Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This code is for delete all the tweets of your profile
/**
* This code work in the https://mobile.twitter.com/YOUR_USERNAME/with_replies
*
*/
const _this = $;
const clickFirstElement = () => {
_this(
".css-18t94o4.css-1dbjc4n.r-1777fci.r-11cpok1.r-1ny4l3l.r-bztko3.r-lrvibr"
).click();
setTimeout(() => {
deleteElement();
}, 1000);
};
const deleteElement = () => {
_this(
".css-1dbjc4n.r-1loqt21.r-18u37iz.r-779j7e.r-23eiwj.r-o7ynqc.r-6416eg.r-13qz1uu"
).click();
setTimeout(() => {
confirmDelete();
}, 1500);
};
const confirmDelete = () => {
_this(
".css-18t94o4.css-1dbjc4n.r-1dgebii.r-42olwf.r-sdzlij.r-1phboty.r-rs99b7.r-16y2uox.r-1w2pmg.r-145lgeb.r-9u3a9d.r-1fneopy.r-o7ynqc.r-6416eg.r-lrvibr"
).click();
setTimeout(() => {
window.scrollBy(0, 300);
clickFirstElement();
}, 3000);
};
clickFirstElement();
@tejxv

This comment has been minimized.

Copy link

tejxv commented May 18, 2020

this doesn't work :(
returns the following error-

 Uncaught TypeError: Cannot read property 'click' of null
    at deleteElement (<anonymous>:14:4)
    at <anonymous>:7:5
@krrskl

This comment has been minimized.

Copy link
Owner Author

krrskl commented May 23, 2020

@tejxv This code alone work in https://mobile.twitter.com/**YOUR_USERNAME**/with_replies

@krystynhi

This comment has been minimized.

Copy link

krystynhi commented Jun 10, 2020

I get this error in Chrome 83.0.4103.97 on https://twitter.com/heide/with_replies. I am logged in to Twitter and all of my Chrome extensions are disabled. Hope this helps!

VM2170:14 Uncaught TypeError: Cannot read property 'click' of null
    at deleteElement (<anonymous>:14:4)
    at <anonymous>:7:5
@FocusWho

This comment has been minimized.

Copy link

FocusWho commented Jun 10, 2020

I get this error in Chrome 83.0.4103.97 on https://twitter.com/heide/with_replies. I am logged in to Twitter and all of my Chrome extensions are disabled. Hope this helps!

VM2170:14 Uncaught TypeError: Cannot read property 'click' of null
    at deleteElement (<anonymous>:14:4)
    at <anonymous>:7:5

This gist hard coded the fixed div selector classes that do not match the obfuscated changing REACT UI that matches widely other things breaking the execution chain running as infinite recursion to itself. My gist uses data selectors that should stay more consistent around among other things, try this:
https://gist.github.com/FocusWho/5a8e74895293eae0071cec612477c72f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.