Compare commits

...

2 Commits

1 changed files with 4 additions and 4 deletions

View File

@ -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: