Closed laere closed 8 years ago
https://api.twitch.tv/kraken/search/streams?q=starcraft
example: streams.channel[0].title => "RERUN: StarCraft 2 - Snute vs. Fantasy (ZvT) - IEM Katowice 2015 - EU Qualifier"
/* Get data from
https://api.twitch.tv/kraken/search/streams?q=starcraft
via ajax json GET call
*/
// Compare function for title to sort
var compare = function(a, b) {
//a.title b.title
if (a.title < b.title) {
return 1;
} else if (a.title > a.title) {
return -1;
} else {
return 0;
}
}
// Use compare function to sort by stream titles.
var sorted_array = streams.channels.sort(compare)
Something along the lines of the above?
I didn't even consider something like that, I will give it a shot, thanks for the advice!
On Tue, Apr 5, 2016 at 8:05 PM, TA notifications@github.com wrote:
https://api.twitch.tv/kraken/search/streams?q=starcraft
example: streams.channel.title => "RERUN: StarCraft 2 - Snute vs. Fantasy (ZvT) - IEM Katowice 2015 - EU Qualifier"
/* Get data from ajax for https://api.twitch.tv/kraken/search/streams?q=starcraft */ // Compare function for title to sort var compare = function(a, b) { //a.title b.title if (a.title < b.title) { return 1; } else if (a.title > a.title) { return -1; } else { return 0; } } // Use compare function to sort by stream titles. var sorted_array = streams.channels.sort(compare)
Something along the lines of the above?
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/justintv/Twitch-API/issues/525#issuecomment-206041991
I would recommend asking these types of questions in the Twitch Developer Forums. Lots of helpful folks there. :)
Currently using the GET /search/streams endpoint for an application. I know that the GET /streams/ endpoint returns a limit of 100 streams, and returns the streams in order from highest to lowest current viewers. Was curious if the same could be done for the aforementioned endpoint in the title, /search/streams?