Esempio n. 1
0
 public static Task <BookmarkTagsPage> GetUserBookmarkTagsAsync(this PixivClient client, Restrict restrict = Restrict.Public)
 {
     client.RequireAuth();
     return(client.GetAsync <BookmarkTagsPage>("/v1/user/bookmark-tags/illust", new HttpForm {
         { "restrict", restrict.GetSymbol() }
     }));
 }
Esempio n. 2
0
 public static Task <IllustsPage> GetFollowedUsersIllustAsync(this PixivClient client, Restrict restrict = Restrict.Public, int offset = 0)
 {
     client.RequireAuth();
     return(client.GetAsync <IllustsPage>("/v2/illust/follow", new HttpForm {
         { "restrict", restrict.GetSymbol() }, { "offset", offset.ToString() }
     }));
 }
Esempio n. 3
0
 public static Task <CommentPage> GetIllustCommentsAsync(this PixivClient client, IllustID id, int offset = 0, bool includeTotalComments = true)
 {
     return(client.GetAsync <CommentPage>("/v1/illust/comments", new HttpForm
     {
         { "illust_id", id },
         { "offset", offset.ToString() },
         { "include_total_comments", includeTotalComments.ToString().ToLower() }
     }));
 }
Esempio n. 4
0
        public static Task <RecommendIllustsPage> GetIllustRecommendAsync(this PixivClient client, ContentType type = ContentType.Illust, bool includeRankingIllusts = true)
        {
            client.RequireAuth();
            var url = "/v1/illust/recommended";

            return(client.GetAsync <RecommendIllustsPage>(url, new HttpForm
            {
                { "content_type", type.GetSymbol() },
                { "include_ranking_illusts", includeRankingIllusts.ToString().ToLower() },
                { "include_ranking_label", "true" } // 我就是不给参数 你能奈我何?
            }));
        }
Esempio n. 5
0
        public static Task <IllustsPage> GetIllustRankingAsync(this PixivClient client, RankMode mode = RankMode.Day, DateTime?date = default, int offset = 0)
        {
            var data = new HttpForm {
                { "offset", offset.ToString() }, { "mode", mode.GetSymbol() }
            };

            if (date != null)
            {
                data.Add("date", date.Value.ToString("yyyy-MM-dd"));
            }

            return(client.GetAsync <IllustsPage>("/v1/illust/ranking", data));
        }
Esempio n. 6
0
        public static Task <IllustsPage> SearchIllustAsync(this PixivClient client, string word, SearchMode mode = SearchMode.PartialMatchTags, SortOptions sortOptions = SortOptions.DateDecreasing, SearchDuration?duration = default, int offset = 0)
        {
            var data = new HttpForm {
                { "word", word }, { "search_target", mode.GetSymbol() }, { "sort", sortOptions.GetSymbol() }, { "offset", offset.ToString() }
            };

            if (duration != null)
            {
                data.Add("duration", duration.GetSymbol());
            }

            return(client.GetAsync <IllustsPage>("/v1/search/illust"));
        }
Esempio n. 7
0
 public static Task <IllustsPage> GetIllustRelatedAsync(this PixivClient client, IllustID id)
 {
     return(client.GetAsync <IllustsPage>("/v2/illust/related", new HttpForm {
         { "user_id", id }
     }));
 }
Esempio n. 8
0
 public static Task <BookmarkDetail> GetIllustBookmarkDetailAsync(this PixivClient client, IllustID id)
 {
     return(client.GetAsync <BookmarkDetail>("/v2/illust/bookmark/detail", new HttpForm {
         { "illust_id", id }
     }));
 }
Esempio n. 9
0
 public static Task <IllustData> GetIllustDetailAsync(this PixivClient client, IllustID id)
 {
     return(client.GetAsync <IllustData>("/v1/illust/detail", new HttpForm {
         { "illust_id", id }
     }));
 }
Esempio n. 10
0
 public static Task <IllustsPage> GetUserBookmarksAsync(this PixivClient client, UserID id, Restrict restrict = Restrict.Public)
 {
     return(client.GetAsync <IllustsPage>("/v1/user/bookmarks/illust", new HttpForm {
         { "user_id", id }, { "restrict", restrict.GetSymbol() }
     }));
 }
Esempio n. 11
0
 public static Task <IllustsPage> GetUserIllustsAsync(this PixivClient client, UserID id, int offset = 0)
 {
     return(client.GetAsync <IllustsPage>("/v1/user/illusts", new HttpForm {
         { "user_id", id }, { "offset", offset.ToString() }
     }));
 }
Esempio n. 12
0
 public static Task <UgoiraData> GetUgoiraMetadataAsync(this PixivClient client, IllustID id)
 {
     return(client.GetAsync <UgoiraData>("/v1/ugoira/metadata", new HttpForm {
         { "illust_id", id }
     }));
 }
Esempio n. 13
0
 public static Task <UserFollowPage> GetUserFollowersAsync(this PixivClient client, UserID id, Restrict restrict = Restrict.Public)
 {
     return(client.GetAsync <UserFollowPage>("/v1/user/follower", new HttpForm {
         { "user_id", id }, { "restrict", restrict.GetSymbol() }
     }));
 }
Esempio n. 14
0
 public static Task <UserDetail> GetUserDetailAsync(this PixivClient client, UserID id)
 {
     return(client.GetAsync <UserDetail>("/v1/user/detail", new HttpForm {
         { "user_id", id }
     }));
 }
Esempio n. 15
0
 public static Task <TrendTags> GetTrendingTagsAsync(this PixivClient client)
 {
     return(client.GetAsync <TrendTags>("/v1/trending-tags/illust"));
 }