Last active
September 5, 2019 19:34
-
-
Save thexavier666/9a835335f54bf01bfa76b3cf93743140 to your computer and use it in GitHub Desktop.
Small py code to check if the season in Skidstorm has been reset or not
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import time | |
import json | |
import requests | |
from datetime import datetime | |
url_str = 'http://api.skidstorm.cmcm.com/v2/rank/list/1-1/ALL' | |
sleep_val = 30 | |
rank_threshold = 20000 | |
while True: | |
# get's details of top ranked skidstorm players | |
p = requests.get(url_str) | |
# converts to a dictionary | |
q = json.loads(p.text) | |
# finds the rank of the player | |
rank_val = q["ranks"][0]["rank"] | |
if rank_val > rank_threshold: | |
print("Season still going on ... Current time {}".format(datetime.now())) | |
time.sleep(sleep_val) | |
else: | |
print("Season ended at ... {}".format(datetime.now())) | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment