aboutsummaryrefslogtreecommitdiff
path: root/follow-src/source.py
diff options
context:
space:
mode:
authorBryson Steck <steck.bryson@gmail.com>2022-03-11 15:25:33 -0700
committerBryson Steck <steck.bryson@gmail.com>2022-03-11 15:25:33 -0700
commitb3e1bd3a1dfdf45fb3d735b3ba9912c66c37e3b9 (patch)
tree68f5c51a250378bb930b8d969a9aa10192057736 /follow-src/source.py
parent0b25b38e43b549221af294298e5e8c671174a122 (diff)
downloadlset-b3e1bd3a1dfdf45fb3d735b3ba9912c66c37e3b9.tar
lset-b3e1bd3a1dfdf45fb3d735b3ba9912c66c37e3b9.tar.gz
lset-b3e1bd3a1dfdf45fb3d735b3ba9912c66c37e3b9.tar.bz2
got python bot working
Diffstat (limited to 'follow-src/source.py')
-rw-r--r--follow-src/source.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/follow-src/source.py b/follow-src/source.py
index e69de29..b17b9ac 100644
--- a/follow-src/source.py
+++ b/follow-src/source.py
@@ -0,0 +1,25 @@
+import requests
+import time
+import json
+
+with open('settings.json') as f:
+ settings = json.load(f)
+
+FOLLOWER_GOAL = settings['follower_goal']
+SUB_GOAL = settings['sub_goal']
+WRITE_FILE = settings['write_file']
+USER = settings['username']
+UPDATE = settings['seconds_interval']
+
+print("Running!")
+while(True):
+ followers = open(WRITE_FILE, 'w')
+ url_follows = "https://api.crunchprank.net/twitch/followcount/" + USER
+ read_follows = requests.get(url_follows)
+ url_subs = "https://decapi.me/twitch/subcount/" + USER
+ read_subs = requests.get(url_subs)
+ #if int(read_follows.text) > followerGoal:
+ # followerGoal += 50
+ print(f"Subs: {read_subs.text}/{SUB_GOAL}\nFollower goal: {read_follows.text}/{FOLLOWER_GOAL}\n", end='', file=followers)
+ followers.close()
+ time.sleep(UPDATE)