Skip to content

zombodotcom/twitchUserData

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation


Logo

Twitch User Data

Get Chatters Followers List Multithreaded get requests for new Twitch API

Table of Contents

New Twitch API

About The Project

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. Example User Data

using plot.ly for the json file generated Shroud Example Plot.ly using plot.ly for the json file generated

Built With

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

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

Installation

  1. Clone the repo
git clone https://github.com/zombodotcom/twitchUserData.git
  1. Install Python packages
pip3 install whatever the package you need
  1. Add Authorization and ClientID to config.py

How to Get Bearer Token Twitch access-tokens How to get a token

Usage

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. Slicing

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

Contributing

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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Acknowledgements

New Twitch API

About

Twitch user Data Follows Python

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages