Hello!
I’m using Python 3 and Twitch API v5 in the project about “association between streamers”.
I want to get list of all channel followers. I just tried an offset, but the number of followers is limited to about 1600.
This is function of code, but this code could only get a limited number of followers.
def collectFollower(channel, lim, Clientid, File, Offset):
url = ("https://api.twitch.tv/kraken/channels/"+ str(channel) +
"/follows?limit=" + str(lim) + "&offset=" + str(Offset))
req = urllib.request.Request(url, headers = {"Client-ID": Clientid, "Accept" : "application/vnd.twitchtv.v5+json"})
u = urllib.request.urlopen(req)
c = u.read().decode('utf-8')
js = json.loads(c)
#print(str(Offset))
#print(str(js["_cursor"]))
for num in range(lim):
file.write(str(js["follows"][num]["user"]["name"]) + "\n")
When I searched through Google, I saw that I used the cursor to solve it. How do you use your cursor? If I can’t use it, how to solve?
Please Help Me!