added steamplayer history script
This commit is contained in:
parent
00aff53d3a
commit
51f0babb69
22
server/nightr/steamplayerhistory.py
Normal file
22
server/nightr/steamplayerhistory.py
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import requests
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
from datetime import datetime
|
||||||
|
import time
|
||||||
|
|
||||||
|
def main():
|
||||||
|
filename = "dotaplayers " + str(datetime.now()) + ".csv"
|
||||||
|
header = {"Client-ID": "F07D7ED5C43A695B3EBB01C28B6A18E5"}
|
||||||
|
appId = 570
|
||||||
|
game_players_url = 'https://api.steampowered.com/ISteamUserStats/GetNumberOfCurrentPlayers/v1/?format=json&appid=' + str(appId)
|
||||||
|
while True:
|
||||||
|
f = open(filename,"a+")
|
||||||
|
game_players = requests.get(game_players_url, headers=header)
|
||||||
|
players_str = str(game_players.json()['response']['player_count'])
|
||||||
|
f.write(players_str + ", " + str(datetime.now()) + "\r\n")
|
||||||
|
print("Game name: Dota 2" + ", Player count: " + str(game_players.json()['response']['player_count']))
|
||||||
|
f.close()
|
||||||
|
time.sleep(100)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
|
@ -2,6 +2,7 @@ import cv2
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from pytz import timezone
|
from pytz import timezone
|
||||||
|
|
||||||
|
|
||||||
def camImgStrat():
|
def camImgStrat():
|
||||||
img = cv2.imread('night.jpg',0)
|
img = cv2.imread('night.jpg',0)
|
||||||
average = img.mean(axis=0).mean(axis=0)
|
average = img.mean(axis=0).mean(axis=0)
|
||||||
|
@ -21,5 +22,3 @@ def australiaStrat():
|
||||||
else:
|
else:
|
||||||
return 0.0
|
return 0.0
|
||||||
|
|
||||||
|
|
||||||
print(australiaStrat())
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user