Skip to content

Instantly share code, notes, and snippets.

@ryanteck
Created March 22, 2020 21:01
Show Gist options
  • Save ryanteck/e46e23c562ac106b993d96483a42d11c to your computer and use it in GitHub Desktop.
Save ryanteck/e46e23c562ac106b993d96483a42d11c to your computer and use it in GitHub Desktop.
Pi Supply Papirus FAH Tracker
from papirus import PapirusTextPos
from time import sleep
import urllib2
import json
#INPUT YOUR TEAM ID HERE
FAHTEAMID="236472"
url = "https://apps.foldingathome.org/stats.py?callback=&user=&team="+str(FAHTEAMID)
response = urllib2.urlopen(url)
html = response.read()
formatted= html[12:-3] #Bodge
json = json.loads(formatted)
#Init Papirus Text
text = PapirusTextPos(False, rotation=180)
#Update screen every 10 minutes.
while True:
text.AddText("Folding @ Home", 10, 10,28)
text.AddText("Team: "+json["team_name"], 10, 40,20)
text.AddText("Total: "+str(json["earned"]), 10, 65,20)
text.AddText("Rank: "+str(json["team_rank"]), 10, 120,30)
text.WriteAll()
sleep(600)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment