示例#1
0
        public IpPort[] GetWhisperServers()
        {
            var resp = new WebClient().DownloadString("http://tmi.twitch.tv/servers?cluster=group");

            var json = JObject.Parse(resp);

            _whisperServers = new IpPort[json.SelectToken("servers").Count()];
            for (var i = 0; i < _whisperServers.Length; i++)
            {
                _whisperServers[i] = new IpPort(json.SelectToken("servers")[i].ToString());
            }
            return(_whisperServers);
        }
示例#2
0
        public IpPort[] GetChatServers(string channel)
        {
            var resp = new WebClient().DownloadString(
                $"https://api.twitch.tv/api/channels/{channel}/chat_properties");

            var json = JObject.Parse(resp);
            _chatServers = new IpPort[json.SelectToken("chat_servers").Count()];
            for (var i = 0; i < _chatServers.Length; i++)
            {
                _chatServers[i] = new IpPort(json.SelectToken("chat_servers")[i].ToString());
            }
            return _chatServers;
        }
示例#3
0
        public IpPort[] GetChatServers(string channel)
        {
            var resp = new WebClient().DownloadString(
                $"https://api.twitch.tv/api/channels/{channel}/chat_properties");

            var json = JObject.Parse(resp);

            _chatServers = new IpPort[json.SelectToken("chat_servers").Count()];
            for (var i = 0; i < _chatServers.Length; i++)
            {
                _chatServers[i] = new IpPort(json.SelectToken("chat_servers")[i].ToString());
            }
            return(_chatServers);
        }
示例#4
0
        public IpPort[] GetWhisperServers()
        {
            var resp = new WebClient().DownloadString("http://tmi.twitch.tv/servers?cluster=group");

            var json = JObject.Parse(resp);
            _whisperServers = new IpPort[json.SelectToken("servers").Count()];
            for (var i = 0; i < _whisperServers.Length; i++)
            {
                _whisperServers[i] = new IpPort(json.SelectToken("servers")[i].ToString());
            }
            return _whisperServers;
        }