File tree Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change 9
9
access_secret = ""
10
10
11
11
12
- def get_all_tweets (screen_name : str ) -> str :
13
- """
14
- Save tweets of a user in a CSV file
15
- >>> get_all_tweets()
16
- 'success'
17
- """
12
+ def get_all_tweets (screen_name : str ) -> None :
18
13
19
14
# authorize twitter, initialize tweepy
20
15
auth = tweepy .OAuthHandler (consumer_key , consumer_secret )
21
16
auth .set_access_token (access_key , access_secret )
22
17
api = tweepy .API (auth )
23
- status = ""
24
18
25
19
# initialize a list to hold all the tweepy Tweets
26
20
alltweets = []
@@ -59,12 +53,9 @@ def get_all_tweets(screen_name: str) -> str:
59
53
writer = csv .writer (f )
60
54
writer .writerow (["id" , "created_at" , "text" ])
61
55
writer .writerows (outtweets )
62
- status = "success"
63
56
64
57
pass
65
58
66
- return status
67
-
68
59
69
60
if __name__ == "__main__" :
70
61
# pass in the username of the account you want to download
You can’t perform that action at this time.
0 commit comments