Get Chatters Followers List Multithreaded get requests for new Twitch API
uses the new twitch api to get chatters from tmi.twitch.tv then convert username to login ID and 100 per request, then gets the first 100 Per username in the list of lists.
it uses rate limiting from the twitch header.
using plot.ly for the json file generated using plot.ly for the json file generated
To get a local copy up and running follow these simple steps.
This is an example of how to list things you need to use the software and how to install them.
from matplotlib import rcParams
import matplotlib.animation as animation
from concurrent.futures import ThreadPoolExecutor as PoolExecutor
import json
import requests
from collections import defaultdict
import time
import pprint
import threading
import logging
import signal
import matplotlib.pyplot as plt
import random
from itertools import count
import config
- Clone the repo
git clone https://github.com/zombodotcom/twitchUserData.git
- Install Python packages
pip3 install whatever the package you need
- Add Authorization and ClientID to config.py
How to Get Bearer Token Twitch access-tokens
run the program and it puts out 2 jsons, the user id's and the total follows.
You can slice in both threaded areas. Just slice like so.
doing this only does 100 chatters instead of all of them from username to userid
with PoolExecutor(max_workers=8) as executor:
# _ is the body of each page that I'm ignoring right now
for _ in executor.map(douserids, composite_id_list[:1]):
# print(composite_viewer_list)
pass
here is for the individual followers threaded code. should get only 100 users with [:1] currently goes through all chatters because no slicing the list
# create a thread pool of 4 threads
# gets the follows multithreaded, change 8 to your max threads
with PoolExecutor(max_workers=8) as executor:
# distribute the 1000 URLs among 4 threads in the pool
# _ is the body of each page that I'm ignoring right now
for x in composite_viewer_list[:1]:
print(x)
for _ in executor.map(dotogether, x):
# print(composite_viewer_list)
pass
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.