1import aiohttp
2import asyncio
3import ssl
4
5
6async def post_request(url, data):
7 ssl_context = ssl.create_default_context()
8 ssl_context.check_hostname = False
9 ssl_context.verify_mode = ssl.CERT_NONE
10
11 async with aiohttp.ClientSession() as session:
12 async with session.post(url, json=data, ssl=ssl_context):
13 pass
14
15
16async def main():
17 url = 'https://api.apify.com/v2/acts/tan_inquisition~twitter-profile-watch/run-sync?token=apify_api_RygsUp9rf4FlGWFXVaSmSeoxajjRzl0euTbZ'
18 run_input = {
19 "opType": "username_to_id",
20 "usernames": ["elonmusk"],
21 "twitterIds": ["44196397"],
22 }
23
24 for _ in range(8):
25 asyncio.create_task(post_request(url, run_input))
26
27 print("All tasks started")
28
29 await asyncio.sleep(1)
30
31
32
33
34