DateFromVitaFormatDate() public static method

public static DateFromVitaFormatDate ( string date ) : string
date string
return string
        public static NicoNicoVitaApiVideoData GetVideoData(string cmsid)
        {
            if (cmsid.Contains("?"))
            {
                cmsid = cmsid.Substring(0, cmsid.IndexOf('?'));
            }


            string result = NicoNicoWrapperMain.Session.GetAsync(VideoDataApiUrl + cmsid).Result;

            var json     = DynamicJson.Parse(result);
            var response = json.nicovideo_video_response;

            var ret = new NicoNicoVitaApiVideoData();

            if (!response.video())
            {
                ret.Success = false;
                return(ret);
            }

            ret.Id             = response.video.id;
            ret.Title          = response.video.title;
            ret.FirstRetrieve  = NicoNicoUtil.DateFromVitaFormatDate(response.video.first_retrieve);
            ret.ViewCounter    = int.Parse(response.video.view_counter);
            ret.CommentCounter = int.Parse(response.thread.num_res);
            ret.MylistCounter  = int.Parse(response.video.mylist_counter);
            ret.Length         = NicoNicoUtil.ConvertTime(long.Parse(response.video.length_in_seconds));
            ret.Description    = response.video.description;
            ret.ThumbnailUrl   = response.video.thumbnail_url;
            return(ret);
        }
Beispiel #2
0
        public static NicoNicoVitaApiMylistData GetMylistData(string mylistId)
        {
            string detail = "0"; //より細かい1も存在
            string result = NicoNicoWrapperMain.GetSession().GetAsync(MylistDataApiUrl + detail + "&group_id=" + mylistId).Result;

            var json     = DynamicJson.Parse(result);
            var response = json.nicovideo_mylistgroup_response;

            NicoNicoVitaApiMylistData ret = new NicoNicoVitaApiMylistData();

            ret.Id                = response.mylistgroup.id;
            ret.UserId            = response.mylistgroup.user_id;
            ret.ViewCount         = response.mylistgroup.view_counter;
            ret.Name              = response.mylistgroup.name;
            ret.Description       = response.mylistgroup.description;
            ret.isPublic          = response.mylistgroup.@public == "1" ? true : false;
            ret.DefaultSort       = int.Parse(response.mylistgroup.default_sort);
            ret.DefaultSortMethod = response.mylistgroup.default_sort_method;
            ret.SortOrder         = int.Parse(response.mylistgroup.sort_order);
            ret.DefaultSortOrder  = response.mylistgroup.default_sort_order;
            ret.IconId            = response.mylistgroup.icon_id;
            ret.UpdateTime        = NicoNicoUtil.DateFromVitaFormatDate(response.mylistgroup.update_time);
            ret.CreateTime        = NicoNicoUtil.DateFromVitaFormatDate(response.mylistgroup.create_time);
            ret.Count             = int.Parse(response.mylistgroup.count);

            NicoNicoVitaApiUserData re = NicoNicoVitaUserApi.GetUserData(ret.UserId);

            ret.UserName = re.Name;

            return(ret);
        }