Skip to content

Instantly share code, notes, and snippets.

@weisjohn
Created May 16, 2013 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weisjohn/5591954 to your computer and use it in GitHub Desktop.
Save weisjohn/5591954 to your computer and use it in GitHub Desktop.
Twitter DM cleanup, use with caution inside a browser session on the site.
// global used to stop things if it get's out of hand
var run = true;
function enter_dm() {
var li = $(".dm-thread-list.js-dm-thread-list").children("li")[5];
$(li).click();
}
function click_delete() {
$(".dm-delete.js-dm-delete").last().click();
}
function confirm_delete() {
$(".btn.caution-btn.js-prompt-ok").click()
}
function ret_to_messages() {
$("a.js-dm-header-title").click();
}
function cycle() {
// do stuff
if (run) {
enter_dm();
setTimeout(function() {
click_delete();
}, 500);
setTimeout(function() {
confirm_delete();
}, 1000);
setTimeout(function() {
ret_to_messages();
}, 2000);
// rinse & repeat
setTimeout(function() {
cycle();
}, 3000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment