- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
#!/usr/bin/env python
import requests
import os,sys
try:
subs = os.getenv("subs").split(",")
except:
sys.exit(1)
config = False
if len(sys.argv) > 1:
if sys.argv[1] == "config":
config = True
if config:
print "graph_title Subreddit Users Online"
print "graph_vlabel users"
print "graph_category reddit"
for sub in subs:
if config:
print sub + ".label Users on /r/" + sub
else:
data = requests.get("http://www.reddit.com/r/" + sub + "/about.json")
print sub + ".value " + str(data.json()['data']['accounts_active'])
Комментарии (0) RSS
Добавить комментарий