예제 #1
0
        public static List <Stream> generateStreams(string gameName)
        {
            dynamic     res     = getResponseFromUrl("https://api.twitch.tv/kraken/streams?game=" + HttpUtility.UrlEncode(gameName) + "&limit=100");
            StreamsJSON streams = JsonConvert.DeserializeObject <StreamsJSON>(res);

            List <Stream> liveChannels = new List <Stream>();

            foreach (Stream stream in streams.streams)
            {
                liveChannels.Add(stream);
            }

            return(liveChannels);
        }
예제 #2
0
        public static List <Stream> generateStreamsFromSearch(string name)
        {
            dynamic     res     = getResponseFromUrl("https://api.twitch.tv/kraken/search/streams?q=" + name);
            StreamsJSON streams = JsonConvert.DeserializeObject <StreamsJSON>(res);

            List <Stream> liveChannels = new List <Stream>();

            foreach (Stream stream in streams.streams)
            {
                liveChannels.Add(stream);
            }

            return(liveChannels);
        }