Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
axsddlr committed Sep 16, 2024
2 parents fcfa3fb + 0e5dcd3 commit 95adfe7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
12 changes: 7 additions & 5 deletions api/scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,13 @@ def vlr_match_results():
return data

@staticmethod
def vlr_stats(region: str, timespan: int):
url = (
f"https://www.vlr.gg/stats/?event_group_id=all&event_id=all&region={region}&country=all&min_rounds=200"
f"&min_rating=1550&agent=all&map_id=all&timespan={timespan}d"
)
def vlr_stats(region: str, timespan: str):
base_url = f"https://www.vlr.gg/stats/?event_group_id=all&event_id=all&region={region}&country=all&min_rounds=200&min_rating=1550&agent=all&map_id=all"

if timespan.lower() == "all":
url = f"{base_url}&timespan=all"
else:
url = f"{base_url}&timespan={timespan}d"

resp = requests.get(url, headers=headers)
html = HTMLParser(resp.text)
Expand Down
5 changes: 4 additions & 1 deletion routers/vlr_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ async def VLR_stats(region, timespan, request: Request):
"sa": "latin-america",\n
"jp": "japan",\n
"oce": "oceania",\n
"mn": "mena",\n
"mn": "mena"\n
timespan:\n
"30": 30 days,\n
"60": 60 days,\n
"90": 90 days,\n
"all": All time\n"
"""
return vlr.vlr_stats(region, timespan)

Expand All @@ -52,6 +53,8 @@ async def VLR_ranks(region, request: Request):
"gc": "game-changers",\n
"br": "Brazil",\n
"cn": "china",\n
"jp": "japan",\n
"col": "collegiate",\n
"""
return vlr.vlr_rankings(region)

Expand Down

0 comments on commit 95adfe7

Please sign in to comment.