else/RedditCSS/stylepusher.py
Voussoir a62f6e582d else
It's been a while since I updated this.
2015-06-25 21:03:45 -07:00

21 lines
393 B
Python

import bot
import os
import praw
import sys
import time
r=bot.rG()
SUBREDDIT = r.get_subreddit(sys.argv[1])
FILENAME = sys.argv[2]
prevtime = 0
while True:
newtime = os.path.getmtime(FILENAME)
if newtime != prevtime:
f=open(FILENAME)
style = f.read()
f.close()
print('Pushing stylesheet. %d bytes' % len(style))
SUBREDDIT.set_stylesheet(style)
prevtime = newtime
time.sleep(5)