From b3e1bd3a1dfdf45fb3d735b3ba9912c66c37e3b9 Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Fri, 11 Mar 2022 15:25:33 -0700 Subject: got python bot working --- follow-src/settings.json | 7 +++++++ follow-src/source.py | 25 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/follow-src/settings.json b/follow-src/settings.json index e69de29..e02bcb5 100644 --- a/follow-src/settings.json +++ b/follow-src/settings.json @@ -0,0 +1,7 @@ +{ + "follower_goal": "500,000", + "sub_goal": "1,000", + "write_file": "/path/to/file/you/want/to/write", + "username": "your_channel_name_goes_here", + "seconds_interval": 10 +} 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) -- cgit v1.2.3