-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexamples.py
More file actions
57 lines (50 loc) · 1.34 KB
/
examples.py
File metadata and controls
57 lines (50 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import asyncio
import data.steam_data
import src.scraper.async_
import src.scraper.sync
# sync
print(
src.scraper.sync.market_scraper_sync(
'Dreams & Nightmares Case',
data.steam_data.Apps.CS2.value,
data.steam_data.Currency.USD.value,
),
)
# async
async def main():
items = [
(
'Dreams & Nightmares Case',
data.steam_data.Apps.CS2.value,
data.steam_data.Currency.USD.value,
),
(
'Mann Co. Supply Crate Key',
data.steam_data.Apps.TEAM_FORTRESS_2.value,
data.steam_data.Currency.EUR.value,
),
(
'Doomsday Hoodie',
data.steam_data.Apps.PUBG.value,
data.steam_data.Currency.GBP.value,
),
(
'AWP | Neo-Noir (Factory New)',
data.steam_data.Apps.CS2.value,
data.steam_data.Currency.USD.value,
),
(
'Snowcamo Jacket',
data.steam_data.Apps.RUST.value,
data.steam_data.Currency.CHF.value,
),
]
tasks = [
src.scraper.async_.market_scraper_async(name, app_id, currency)
for name, app_id, currency in items
]
results = await asyncio.gather(*tasks)
for result in results:
print(result)
if __name__ == '__main__':
asyncio.run(main())