Skip to content

Instantly share code, notes, and snippets.

@melissamcewen
Last active October 18, 2019 09:19
Show Gist options
  • Save melissamcewen/37125ee31615f3f7f53de47459053bf1 to your computer and use it in GitHub Desktop.
Save melissamcewen/37125ee31615f3f7f53de47459053bf1 to your computer and use it in GitHub Desktop.
def delete(api, date, r):
with open("likes.csv") as file:
count = 0
for row in csv.DictReader(file):
tweet_id = int(row["tweet_id"])
try:
print "Deleting like"
api.CreateFavorite(status_id=tweet_id)
api.DestroyFavorite(status_id=tweet_id)
print tweet_id
print count
count += 1
time.sleep(0.7)
except twitter.TwitterError, err:
print "Exception: %s\n" % err.message
print "Number of unliked tweets: %s\n" % count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment