Retweet Deleter and Like Deleter

 Retweet

const timer = ms => new Promise(res => setTimeout(res, ms));


// Unretweet normally

const unretweetTweet = async (tweet) => {

      await tweet.querySelector('div[data-testid="unretweet"]').click();

      await timer(250);

      await document.querySelector('div[data-testid="unretweetConfirm"]').click();

      console.log('****// Unretweeted Successfully //****')

}


// Sometimes twitter shows your retweet but green retweet button is invisible and therefore you need to retweet again for make unreweet. This function is for that.

const unretweetUnretweetedTweet = async (tweet) => {

      await tweet.querySelector('div[data-testid="retweet"]').click();

      await timer(250);

      await document.querySelector('div[data-testid="retweetConfirm"]').click();

      console.log('****// Retweeted Successfully //****')

      await timer(250);

      unretweetTweet(tweet);

}


setInterval(async () =>

{

      // Get all tweets

      const retweetedTweetList = document.querySelectorAll('span[data-testid="socialContext"]');

      console.log('****// Retweeted Tweet List Collected //****')

      for (const retweet of retweetedTweetList) {

            const tweetWrapper = retweet.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement;

            tweetWrapper.scrollIntoView();

            

            const isRetweeted = tweetWrapper.querySelector('div[data-testid="unretweet"]');

            if (isRetweeted) {

                  console.log('****// Green Retweet Button Found - Starting "unretweetTweet" process //****')

                  await unretweetTweet(tweetWrapper);

            } else {

                  console.log('****// Green Retweet Button Not Found - Starting "unretweetUnretweetedTweet" process //****')

                  await unretweetUnretweetedTweet(tweetWrapper);

            }

            await timer(2000);

      }

      console.log('****// List Completed //****')

      console.log('****// Scrolling //****')

      console.log('                  ')

      console.log('                  ')

      console.log('                  ')

      console.log('                  ')

      console.log('                  ')

      console.log('                  ')

      console.log('                  ')

      console.log('                  ')

      await window.scrollTo(0, document.body.scrollHeight);

}, 60000);

can you please tell me how to use this and how can i tell if its working?

Here's the steps:

Open your twitter profile
Switch retweets tab
Open your browser devtools (Pressing F12)
Click the console tab
Paste the code into console and wait
The script begins after 60 second.


---------


Like Deleter


const timer = ms => new Promise(res => setTimeout(res, ms));

setInterval(async () =>
{
      const tweetsLikeButtonList = document.querySelectorAll('div[data-testid="unlike"]');
      console.log('****// ' + tweetsLikeButtonList.length + 'Like Found! //****')
      for (const button of tweetsLikeButtonList) {
            button.scrollIntoView();
            await button.click();
            console.log('****// Unliked //****');
            await timer(1250);
      }
      console.log('****// List Completed //****')
      console.log('****// Scrolling //****')
      console.log('                  ')
      console.log('                  ')
      console.log('                  ')
      console.log('                  ')
      console.log('                  ')
      console.log('                  ')
      console.log('                  ')
      console.log('                  ')
      window.scrollTo(0, document.body.scrollHeight)
}, 60000)





Comments

Popular Posts