コード例 #1
0
 public TwitchList<Stream> GetFollowedStreams(PagingInfo pagingInfo = null)
 {
     var request = GetRequest("streams/followed", Method.GET);
     TwitchHelper.AddPaging(request, pagingInfo);
     var response = restClient.Execute<TwitchList<Stream>>(request);
     return response.Data;
 }
コード例 #2
0
 public TwitchList<FollowedChannel> GetFollowedChannels(string user, PagingInfo pagingInfo = null, SortDirection sortDirection = SortDirection.desc, SortType sortType = SortType.created_at)
 {
     var request = GetRequest("users/{user}/follows/channels", Method.GET);
     request.AddUrlSegment("user", user);
     TwitchHelper.AddPaging(request, pagingInfo);
     request.AddParameter("direction", sortDirection);
     request.AddParameter("sortby", sortType);
     var response = restClient.Execute<TwitchList<FollowedChannel>>(request);
     return response.Data;
 }
コード例 #3
0
 public TwitchList<Video> GetChannelVideos(string channel, bool broadcasts = false, bool hls = false, PagingInfo pagingInfo = null)
 {
     var request = GetRequest("channels/{channel}/videos", Method.GET);
     request.AddUrlSegment("channel", channel);
     request.AddParameter("broadcasts", broadcasts);
     request.AddParameter("hls", hls);
     TwitchHelper.AddPaging(request, pagingInfo);
     var response = restClient.Execute<TwitchList<Video>>(request);
     return response.Data;
 }
コード例 #4
0
 public TwitchList<Follower> GetFollowers(PagingInfo pagingInfo = null, SortDirection sortDirection = SortDirection.asc)
 {
     var request = GetRequest("channels/{channel}/follows", Method.GET);
     request.AddUrlSegment("channel", username);
     TwitchHelper.AddPaging(request, pagingInfo);
     request.AddParameter("direction", sortDirection);
     var response = restClient.Execute<TwitchList<Follower>>(request);
     return response.Data;
 }
コード例 #5
0
ファイル: TwitchHelper.cs プロジェクト: ocgineer/OakBot
 public static void AddPaging(IRestRequest request, PagingInfo pagingInfo)
 {
     if (pagingInfo == null) return;
     request.AddParameter("limit", pagingInfo.PageSize);
     request.AddParameter("offset", pagingInfo.Skip);
 }
コード例 #6
0
 public TwitchList<Follower> GetFollowers(string channel, PagingInfo pagingInfo = null)
 {
     var request = GetRequest("channels/{channel}/follows", Method.GET);
     request.AddUrlSegment("channel", channel);
     TwitchHelper.AddPaging(request, pagingInfo);
     var response = restClient.Execute<TwitchList<Follower>>(request);
     return response.Data;
 }
コード例 #7
0
 public TwitchList<Stream> SearchStreams(string query, bool hls, PagingInfo pagingInfo = null)
 {
     var request = GetRequest("search/streams", Method.GET);
     request.AddParameter("query", query);
     request.AddParameter("hls", hls);
     TwitchHelper.AddPaging(request, pagingInfo);
     var response = restClient.Execute<TwitchList<Stream>>(request);
     return response.Data;
 }
コード例 #8
0
 public TwitchList<Game> SearchGames(string query, bool live = false, PagingInfo pagingInfo = null)
 {
     var request = GetRequest("search/games", Method.GET);
     request.AddParameter("query", query);
     request.AddParameter("type", "suggest");                // currently no other types than "suggest"
     request.AddParameter("live", live);                     // if live = true, only returns games that are live on at least one channel.
     TwitchHelper.AddPaging(request, pagingInfo);
     var response = restClient.Execute<TwitchList<Game>>(request);
     return response.Data;
 }
コード例 #9
0
 public TwitchList<Channel> SearchChannels(string query, PagingInfo pagingInfo = null)
 {
     var request = GetRequest("search/channels", Method.GET);
     request.AddParameter("query", query);
     TwitchHelper.AddPaging(request, pagingInfo);
     var response = restClient.Execute<TwitchList<Channel>>(request);
     return response.Data;
 }
コード例 #10
0
 public TwitchList<Video> GetTopVideos(string game = null, PeriodType period = PeriodType.week, PagingInfo pagingInfo = null)
 {
     var request = GetRequest("videos/top", Method.GET);
     request.AddSafeParameter("game", game);
     request.AddParameter("period", period);
     TwitchHelper.AddPaging(request, pagingInfo);
     var response = restClient.Execute<TwitchList<Video>>(request);
     return response.Data;
 }
コード例 #11
0
 public TwitchList<TopGame> GetTopGames(PagingInfo pagingInfo = null)
 {
     var request = GetRequest("games/top", Method.GET);
     TwitchHelper.AddPaging(request, pagingInfo);
     var response = restClient.Execute<TwitchList<TopGame>>(request);
     return response.Data;
 }
コード例 #12
0
 public TwitchList<Stream> GetStreams(string game = null, string channel = null, string clientId = null, PagingInfo pagingInfo = null)
 {
     var request = GetRequest("streams", Method.GET);
     request.AddSafeParameter("game", game);
     request.AddSafeParameter("channel", channel);
     TwitchHelper.AddPaging(request, pagingInfo);
     request.AddSafeParameter("client_id", clientId);
     var response = restClient.Execute<TwitchList<Stream>>(request);
     return response.Data;
 }