Initialcommit

master
Hofei90 5 years ago
parent 957ab71ec6
commit cf21bf0f0f

@ -0,0 +1,26 @@
import peewee
database = peewee.Proxy()
class BaseModel(peewee.Model):
class Meta:
database = database
class CoDUser(BaseModel):
user = peewee.TextField()
class CoDStats(BaseModel):
ts = peewee.DateTimeField()
typ = peewee.TextField()
value = peewee.FloatField()
class Meta:
primary_key = peewee.CompositeKey('ts', 'typ')
def create_tables():
database.create_tables([TestPeewee])

@ -0,0 +1,19 @@
"""
Links:
https://api.tracker.gg/api/v2/modern-warfare/standard/profile/battlenet/Hofei%232237
https://api.tracker.gg/api/v2/modern-warfare/standard/profile/battlenet/Hofei%232237/segments/killstreak?
https://api.tracker.gg/api/v2/modern-warfare/standard/profile/battlenet/Hofei%232237/segments/weapon?
"""
import requests
import json
import toml
import pprint
URL = "https://api.tracker.gg/api/v2/modern-warfare/standard/profile/battlenet/Hofei%232237"
r = requests.get(URL)
j_r = json.loads(r.text)
#pprint.pprint(j_r)
print(j_r["data"])

@ -0,0 +1,3 @@
peewee~=3.13.3
requests~=2.23.0
toml~=0.10.0
Loading…
Cancel
Save