Esempio n. 1
0
        public static Uri ConvertToUrl(INiconicoObject content)
        {
            Uri uri = null;

            switch (content)
            {
            case IUser user:
                uri = new Uri(NiconicoUrls.MakeUserPageUrl(user.UserId));
                break;

            case IVideoContent videoContent:
                uri = new Uri(NiconicoUrls.MakeWatchPageUrl(videoContent.VideoId));
                break;

            case IMylist mylist:
                uri = new Uri(NiconicoUrls.MakeMylistPageUrl(mylist.MylistId));
                break;

            case ILiveContent live:
                uri = new Uri(NiconicoUrls.MakeLiveWatchPageUrl(live.LiveId));
                break;

            case IChannel channel:
                uri = new Uri(NiconicoUrls.MakeChannelPageUrl(channel.ChannelId));
                break;

            case ICommunity community:
                uri = new Uri(NiconicoUrls.MakeCommunityPageUrl(community.CommunityId));
                break;

            default:
                break;
            }

            return(uri);
        }
Esempio n. 2
0
 private static Task <string> GetUserDetailDataAsync(NiconicoContext context, string user_id)
 {
     // 投稿動画件数を同時に取得するため、ユーザーのvideoページからHTMLを取得する
     return(context
            .GetConvertedStringAsync($"{NiconicoUrls.MakeUserPageUrl(user_id)}/video"));
 }
 public static async Task <string> GetUserMylistDataAsync(NiconicoContext context, string user_id)
 {
     return(await context
            .GetConvertedStringAsync(NiconicoUrls.MakeUserPageUrl(user_id) + "/mylist"));
 }