Skip to content

Instantly share code, notes, and snippets.

@reallyfancy
Created October 16, 2017 12:03
Show Gist options
  • Save reallyfancy/58940809dcbf4f6f96c903f9197ee615 to your computer and use it in GitHub Desktop.
Save reallyfancy/58940809dcbf4f6f96c903f9197ee615 to your computer and use it in GitHub Desktop.
Script for deleting a specific tweet by ID. This is useful when you want to un-retweet something that you retweeted from a user who has subsequently become private or blocked you.
# Pre-requisites: Python and tweepy. You will also need to register a Twitter app here: https://apps.twitter.com/
# To use: replace XXXXXX with the appropriate info and run the script.
# Tip: To find the ID of a retweet, view the page source in your browser and look for data-retweet-id.
import tweepy
# auth and api
consumer_key = 'XXXXXX'
consumer_secret = 'XXXXXX'
access_token = 'XXXXXX'
access_token_secret = 'XXXXXX'
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
api.destroy_status(XXXXXX)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment