diff options
| author | dee-oh-double-gee <beaugraham+github@gmail.com> | 2017-02-24 21:40:56 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-24 21:40:56 -0700 |
| commit | 45b51743ad0bbe3aca2787966d2cbe1285fc49db (patch) | |
| tree | 73f95960dab0b080c5b0cd6be43781fd3d6b0b18 | |
| parent | 414c599bb590f592f7f1e765ce89c4bb9a71829a (diff) | |
Create YouTubeSubCount.py
| -rw-r--r-- | YouTubeSubCount.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/YouTubeSubCount.py b/YouTubeSubCount.py new file mode 100644 index 0000000..95cfd6d --- /dev/null +++ b/YouTubeSubCount.py @@ -0,0 +1,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=YOUTUBE_IT&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 "Beau Knows Tech... Stuff Channel Stats:" + print "Total number of subscribers: %s" % (subs) + print "Total number of views: %s" % (views) + |
