Last active
September 28, 2017 04:43
-
-
Save dolpen/90ac5a3b3474d70f1fcbb3a7ae57294b to your computer and use it in GitHub Desktop.
氷河期用 python3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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