Kgtkr's Blog

Posts about "twitter"

All tags
2018/08/17
CK/CS/TK/TSに認証情報を、LIST_NAMEにリスト名を入れて実行すると同期されます import os import tweepy def list_split(n: int, list): return [list[i:i+n] for i in range(0, len(list), n)] # 環境変数取得 ck = os.environ["CK"] cs = os.environ["CS"] tk = os.environ["TK"] ts = os.environ["TS"] list_name = os.environ["LIST_NAME"] # 認証 auth = tweepy.OAuthHandler(ck, cs) auth.set_access_token(tk, ts) api = tweepy.API(auth) # リストを検索 list_id = None for x in api.lists_all(): if x.name == list_name: li