costmuffled

delmail

Nov 23rd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function delmail() {
  2.   const search_re=/Torrent Deleted -/g
  3.   found=0; deleted=0;
  4.   $("#tabs-sent > table > tbody > *").find("a").each(function(){
  5.     found++;
  6.     if (search_re.test($(this)[0].title) &&
  7.        ($($(this)[0].parentElement).find("img").length) &&
  8.        ($($(this)[0].parentElement).find("img")[0].src=="https://animetorrents.me/images/star-full.png")){
  9.       $.get(
  10.         "https://animetorrents.me/user-messages.php",
  11.         {
  12.           msgid: $(this)[0].href.replace(/.*msgid=(\d+).*/g,"$1"),
  13.           DeleteMsg: "Delete"
  14.         }
  15.       );
  16.       deleted++;
  17.     };
  18.   });
  19.   console.log("Found "+found+" message"+(found==1?".":"s."));
  20.   console.log("Deleted "+deleted+" message"+(deleted==1?".":"s."));
  21. }
  22.  
  23. //
  24. // Example of use. Browse to https://animetorrents.me/user-messages.php#tabs-sent
  25. // Open your developer console (chrome ctrl-shift-j, firefox ctrl-shift-k), and paste the function above.
  26. // After that, invoke with no arguments.
  27. // Note - Only messages with titles containing "Torrent Deleted -" and that were sent with a Prompt User
  28. //        will be deleted. This includes all normal torrent delete messages, but not replies to them.
  29. //
  30.  
  31. // delmail();
  32. // Found 1252 messages.
  33. // Deleted 13 messages.
Add Comment
Please, Sign In to add comment