[+] Forgot to add api as a param

This commit is contained in:
Hykilpikonna
2021-11-21 23:05:06 -05:00
parent f1a4c95fae
commit 2be16d2dfb
+3 -2
View File
@@ -122,7 +122,7 @@ def download_user_tweets(api: API, screen_name: str) -> None:
f.write(json_stringify(postings)) f.write(json_stringify(postings))
def download_users(start_point: str, n: float = math.inf, def download_users(api: API, start_point: str, n: float = math.inf,
base_dir: str = './data/twitter/user/', base_dir: str = './data/twitter/user/',
rate_limit: int = 10) -> None: rate_limit: int = 10) -> None:
""" """
@@ -145,6 +145,7 @@ def download_users(start_point: str, n: float = math.inf,
Then, we can obtain a list of all users we have downloaded just by obtaining a list of all Then, we can obtain a list of all users we have downloaded just by obtaining a list of all
files under this directory. files under this directory.
:param api: Tweepy's API object
:param start_point: Starting user's screen name. :param start_point: Starting user's screen name.
:param n: How many users do you want to download? (Default: math.inf) :param n: How many users do you want to download? (Default: math.inf)
:param base_dir: The downloads folder (Default: "./data/twitter/user/") :param base_dir: The downloads folder (Default: "./data/twitter/user/")
@@ -263,4 +264,4 @@ def convert_to_generic(username: str, tweet: Tweet) -> Posting:
if __name__ == '__main__': if __name__ == '__main__':
conf = load_config() conf = load_config()
api = tweepy_login(conf) api = tweepy_login(conf)
download_users('sauricat')