blob: c3a6e0d09522f4d3d767f40cd3cd8aaef130b014 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/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=CHANNEL_ID&key=YOUTUBE_DATA_API_V3')
j = r.json()
subs = j['items'][0]['statistics']['subscriberCount']
views = j['items'][0]['statistics']['viewCount']
#while True:
time.sleep(60)
os.system('clear')
print "YOUR CHANNEL Channel Stats:"
print "Total number of subscribers: %s" % (subs)
print "Total number of views: %s" % (views)
|