Skip to content

Instantly share code, notes, and snippets.

@yaqinking
Created September 22, 2017 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yaqinking/b7abca6164366088767627ca1c164d96 to your computer and use it in GitHub Desktop.
Save yaqinking/b7abca6164366088767627ca1c164d96 to your computer and use it in GitHub Desktop.
Windows 10 local push notification python script to see Tricolour Lovestory owners number.
'''
Windows 10 local push notification python script to see Tricolour Lovestory owners number.
by yaqinking
See image: https://i.imgur.com/fC69kJs.png
'''
import requests
from win10toast import ToastNotifier #https://github.com/jithurjacob/Windows-10-Toast-Notifications
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36'
}
json = requests.get('https://steamspy.com/api.php?request=appdetails&appid=668630', headers=headers).json()
owners = json['owners']
owners_variance = json['owners_variance']
content = str.format('Owners: {0} ± {1}' ,owners, owners_variance)
toaster = ToastNotifier()
toaster.show_toast('Tricolour Lovestory steamspy', content,'./icon.ico', duration=10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment