Compare commits
2 Commits
3d644ea562
...
1f2dc34a70
Author | SHA1 | Date |
---|---|---|
Annika Backstrom | 1f2dc34a70 | |
Annika Backstrom | 7531161a24 |
8
xoxo.py
8
xoxo.py
|
@ -36,7 +36,7 @@ class InkyDraw:
|
|||
def update(self, stats):
|
||||
self.users = stats['new_users']
|
||||
self.statuses = stats['new_statuses']
|
||||
self.hashtag = stats['new_hashtags']
|
||||
self.hashtags = stats['new_hashtags']
|
||||
|
||||
def write(self):
|
||||
self.image = Image.open("graphics/xoxo.png")
|
||||
|
@ -59,10 +59,10 @@ if __name__ == '__main__':
|
|||
last_id = 0
|
||||
while True:
|
||||
result = requests.get("https://xoxo-zone-stats.glitch.me/").json()
|
||||
if result['stats'] != last_stats:
|
||||
draw.update(result['stats'])
|
||||
if result != last_stats:
|
||||
draw.update(result)
|
||||
draw.write()
|
||||
last_stats = result['stats']
|
||||
last_stats = result
|
||||
time.sleep(30)
|
||||
|
||||
# vim:ts=2 sw=2 et:
|
||||
|
|
Loading…
Reference in New Issue