Skip to content

Instantly share code, notes, and snippets.

@dolpen
Last active September 28, 2017 04:43
Show Gist options
  • Save dolpen/90ac5a3b3474d70f1fcbb3a7ae57294b to your computer and use it in GitHub Desktop.
Save dolpen/90ac5a3b3474d70f1fcbb3a7ae57294b to your computer and use it in GitHub Desktop.
氷河期用 python3
# pip3 install tweepy
import csv
import time
import tweepy
words = ['ヤバいワード', 'yabai', 'やばい', 'うんこ']
def tweets():
with open('path/to/tweets.csv', 'r') as f:
filtered = list(filter(
lambda r: '' == r[6] and 0 != len(
list(
filter(lambda w: w in r[5], words)
)
), csv.reader(f)
))
return filtered
def main():
auth = tweepy.OAuthHandler('consumer_key','consumer_secret')
auth.set_access_token('access_token','access_token_secret')
api = tweepy.API(auth)
for tweet in tweets():
api.destroy_status(int(tweet[0]))
time.sleep(0.4)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment