INNER CODE UNIT · Python

steps

KiranGershenfeld/VisualizingTwitchCommunities · DataCollection/TopStreamers.py:10

    steps = math.ceil(NUM_CHANNELS / 100.0)

    channel_list = []
    for step in range(steps):
        start_index = step * 100

        try:
            request = requests.get(f'https://sullygnome.com/api/tables/channeltables/getchannels/7/0/0/3/desc/{start_index}/100', headers=headers)
        except HTTPError as e:
            print(e)
            return

        if(request.status_code == 200):
            data = request.json()['data']
            channels = [channel['url'] for channel in data]
            channel_list.extend(channels)
        else:
            print(f"Response returned with status code: {request.status_code}")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…