Commit c919a4d 1 parent 972770b commit c919a4d Copy full SHA for c919a4d
File tree 2 files changed +41
-3
lines changed
2 files changed +41
-3
lines changed Original file line number Diff line number Diff line change @@ -68,9 +68,7 @@ client.create_tweet(
68
68
)
69
69
```
70
70
71
- More Examples: [ example.py] ( https://github.com/d60/twikit/blob/main/example.py ) <br >
72
- Async Examples: [ example_async.py] ( https://github.com/d60/twikit/blob/main/example_async.py ) <br >
73
- Rate Limits: [ ratelimits.md] ( https://github.com/d60/twikit/blob/main/ratelimits.md )
71
+ More Examples: [ examples] ( https://github.com/d60/twikit/tree/main/examples ) <br >
74
72
75
73
## Contributing
76
74
I would like to hear your thoughts and suggestions.
Original file line number Diff line number Diff line change
1
+ import asyncio
2
+ import time
3
+
4
+ from twikit .twikit_async import Client
5
+
6
+ AUTH_INFO_1 = '...'
7
+ AUTH_INFO_2 = '...'
8
+ PASSWORD = '...'
9
+
10
+ client = Client ('en-US' )
11
+
12
+
13
+ async def main ():
14
+ started_time = time .time ()
15
+
16
+ client .load_cookies ('cookies.json' )
17
+ client_user = await client .user ()
18
+
19
+ # Get all posts
20
+ all_tweets = []
21
+ tweets = await client_user .get_tweets ('Replies' )
22
+ all_tweets += tweets
23
+
24
+ while len (tweets ) != 0 :
25
+ tweets = await tweets .next ()
26
+ all_tweets += tweets
27
+
28
+ tasks = []
29
+ for tweet in all_tweets :
30
+ tasks .append (tweet .delete ())
31
+
32
+ gather = asyncio .gather (* tasks )
33
+ await gather
34
+
35
+ print (
36
+ f'Deleted { len (all_tweets )} tweets\n '
37
+ f'Time: { time .time () - started_time } '
38
+ )
39
+
40
+ asyncio .run (main ())
You can’t perform that action at this time.
0 commit comments