Bot gets other results then browser

require 'json'
require 'net/http'

APIURL = 'https://api.twitch.tv/kraken/channels/buffalowave/follows?limit=5&offset=0&direction=desc'

parsed = JSON.parse(Net::HTTP.get(URI.parse(APIURL)))
followerarray = parsed['follows']
latestfollowerhash = followerarray.at(1)
@latestfollower = latestfollowerhash['user']['display_name']
puts "#{@latestfollower} is the latest follower"

So I’m calling the API but I am getting different results with the script and with my browsers…
It seams to be like the bot gets the results offset by like 1 follow.

Any ideas on how to fix this?

(This happens with any channel)

I’m not familiar with the language you’re using, but most start indexing from 0, which would make followerarray.at(1) the 2nd follower in the array.

Thanks… I probably should have come up with that by myself…

(This topic can get closed now)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.