summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@omgwallhack.org>2016-08-13 23:22:17 -0700
committerJoe Rayhawk <jrayhawk@omgwallhack.org>2016-08-13 23:22:17 -0700
commit074e60dfb020245e1ae6148b22d1faeaae6dd965 (patch)
tree51003f36baa45c6fc8e28c628799c4f4da48b7dd
parent8d2dd49716c3bf9439e6f1ed192edf46570874de (diff)
downloadtwitchtools-074e60dfb020245e1ae6148b22d1faeaae6dd965.tar.gz
twitchtools-074e60dfb020245e1ae6148b22d1faeaae6dd965.zip
lstwitch: fix offset problems
-rwxr-xr-xlstwitch.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lstwitch.rb b/lstwitch.rb
index be71fc0..cf8af46 100755
--- a/lstwitch.rb
+++ b/lstwitch.rb
@@ -27,10 +27,10 @@ end
while offset < total
- response = JSON.parse(http.request(Net::HTTP::Get.new("/kraken/streams/?offset=#{offset}#{game}")).body)
+ response = JSON.parse(http.request(Net::HTTP::Get.new("/kraken/streams/?limit=100&offset=#{offset}#{game}")).body)
total = response["_total"]
for stream in response['streams']
- printf( "%-45s %-36s %6i %6i %-.#{width-46-37-7-7}s\n", stream['channel']['url'].to_s, stream['channel']['game'].to_s, stream['viewers'], stream['channel']['followers'], stream['channel']['status'].to_s.gsub(/\n/,'') )
+ printf( "%-45s %-36s %6i %6i %-.#{width-46-37-7-7}s\n", stream['channel']['url'].to_s.sub(/http:\/\/.+?\./,''), stream['channel']['game'].to_s, stream['viewers'].to_i, stream['channel']['followers'].to_i, stream['channel']['status'].to_s.gsub(/\n/,'') )
end
offset += 100