blob: 381aec5f04e52582c82d307dffe0598af197e5f1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#!/usr/bin/python
import requests
import json
import time
import os
while True:
r = requests.get('https://www.googleapis.com/youtube/v3/channels?part=statistics&id=UCXUuGvjW1KLq6oqfEX0BieQ&key=AIzaSyC6xLODu34WFpDHdqaQf8Lfmokh5wYX_is')
j = r.json()
subs = j['items'][0]['statistics']['subscriberCount']
views = j['items'][0]['statistics']['viewCount']
time.sleep(5)
os.system('clear')
print "YOUR CHANNEL Channel Stats:"
print "Total number of subscribers: %s" % (subs)
print "Total number of views: %s" % (views)
|