public override void ParseData(string str) { JObject obj = JObject.Parse(str); try { base.ListOfACContent = new List <AcContent>(); var datas = obj["data"]["list"].ToList(); foreach (var item in datas) { var ac = new AcContent(); ac.Bangumi = new Bangumi(); ac.Cover = item["cover"].ToString(); ac.Bangumi.BangumiId = item["id"].ToString(); ac.Bangumi.Week = item["week"].ToString(); ac.Title = item["title"].ToString(); //ac.Description = item["intro"].ToString(); ac.Bangumi.Title = ac.Bangumi.LastVideoName = item["lastVideoName"].ToString(); ac.UpdatedAt = item["lastUpdateTime"].ToString(); if (isTV) { var acid = item["linkUrl"].ToString(); ac.id = ParseTVData(acid); } base.ListOfACContent.Add(ac); } } catch (Exception ex) { ACDEBUG.Print(ex.Message); } }
private AcContent ParseContentsData(JToken token, string type) { AcContent ac = new AcContent(); try { // var id = token["id"].ToString(); var image = token["image"].ToString(); var title = token["title"].ToString(); var url = token["url"].ToString(); // ac.id = id; ac.Cover = image; ac.Title = title; ac.ContentId = ac.ACURL = url; if (type == "videos") { var intro = token["intro"].ToString(); ac.Description = intro; base.ParseVisit(token["visit"], ac); } if (type == "users") { //todo } } catch { } return(ac); }
private void GetVideoData(JToken item) { AXFContent axfc = new AXFContent(); axfc.Belong = item["belong"].ToString(); axfc.ChannelId = item["channelId"].ToString(); axfc.ContentCount = item["contentCount"].ToString(); axfc.Id = item["id"].ToString(); axfc.IMG = item["image"].ToString(); axfc.Name = item["name"].ToString(); var contents = item["contents"].Children(); foreach (var content in contents) { var ac = new AcContent(); try { ac.id = content["id"].ToString(); } catch { } ac.Cover = content["image"].ToString(); ac.Title = content["title"].ToString(); ac.ContentId = content["url"].ToString(); if (axfc.Contents == null) { axfc.Contents = new List <AcContent>(); } axfc.Contents.Add(ac); } DataOfDic.Add(axfc.Name, axfc); }
public override void ParseData(string str) { try { var job = JObject.Parse(str); var datas = job["data"]["data"].Children(); foreach (var data in datas) { var ac = new AcContent(); ac.Description = data["description"].ToString(); ac.Title = data["title"].ToString(); ac.ContentId = data["id"].ToString(); ac.Cover = data["coverImage"].ToString(); ac.Visit = new ACVisit(); ac.Visit.Views = data["viewCount"].ToString(); //if (base.ListOfACContent==null) //{ // base.ListOfACContent = new List<AcContent>(); //} //base.ListOfACContent.Add(ac); base.CollectionOfACContent.Add(ac); } } catch (Exception ex) { ACDEBUG.Print(ex.Message); } // base.ParseData(str); }
public override void ParseData(string str) { try { var obj = JObject.Parse(str); var data = obj["data"]; var latestVideo = obj["data"]["latestVideo"]; var tags = obj["data"]["tags"].ToList(); var videos = obj["data"]["videos"].ToList(); var visit = obj["data"]["visit"]; base.ListOfACContent = new List <AcContent>(); var ac = new AcContent(); ac.Bangumi = new Bangumi(); //base data ac.Bangumi.BangumiId = data["bangumiId"].ToString(); ac.Cover = data["cover"].ToString(); ac.Bangumi.CopyRight = data["copyright"].ToString(); ac.Description = data["intro"].ToString(); ac.Bangumi.Month = data["month"].ToString(); ac.Title = data["title"].ToString(); ac.Bangumi.Week = data["week"].ToString(); ac.Bangumi.PlayWay = data["playWay"].ToString(); ac.Bangumi.Year = data["year"].ToString(); //latest video //todo //tags //todo //videos ac.DetailVideos = new List <VideoDetail>(); foreach (var video in videos) { VideoDetail vd = new VideoDetail(); vd.BangumiId = video["bangumiId"].ToString(); vd.DanmakuId = video["danmakuId"].ToString(); vd.SourceId = video["sourceId"].ToString(); vd.SourceType = video["sourceType"].ToString(); vd.Title = video["title"].ToString(); vd.VideoId = video["videoId"].ToString(); vd.VisibleLevel = video["visibleLevel"].ToString(); //vd.UpdateTime = video["updateTime"].ToString(); ac.DetailVideos.Add(vd); } //visit ac.Visit = new ACVisit(); base.ParseVisit(visit, ac); base.ListOfACContent.Add(ac); } catch (Exception ex) { ACDEBUG.Print(ex.Message); } }
private void ParseBangumiData(JToken bangumi, AcContent ac) { ac.Bangumi.BangumiId = bangumi["bangumiId"].ToString(); ac.Bangumi.Sort = bangumi["sort"].ToString(); ac.Bangumi.Title = bangumi["title"].ToString(); ac.Bangumi.VideoId = bangumi["videoId"].ToString(); base.TestProtectedFunc(); }
virtual public void ParseOwner(JToken owner, AcContent ac) { if (ac.User == null) { ac.User = new ACUser(); } ac.User.UserImg = owner["avatar"].ToString(); ac.User.UserId = owner["id"].ToString(); ac.User.Username = owner["name"].ToString(); }
virtual public void ParseData(string str) { try { JObject obj = JObject.Parse(str); ListOfACContent = new List <AcContent>(); var msg = obj["message"]; if (msg.ToString().ToUpper() == "OK") { var list = obj["data"]["list"].ToList(); foreach (var item in list) { var ac = new AcContent(); JToken owner = item["owner"]; JToken visit = item["visit"]; ac.ChannelId = item["channelId"].ToString(); ac.ContentId = item["contentId"].ToString(); ac.Cover = item["cover"].ToString(); ac.Description = item["description"].ToString(); ac.IsArticle = item["isArticle"].ToString(); ac.IsRecommend = item["isRecommend"].ToString(); ac.ReleaseDate = item["releaseDate"].ToString(); ac.Status = item["status"].ToString(); ac.Title = item["title"].ToString(); ac.UpdatedAt = item["updatedAt"].ToString(); if (owner != null) { ac.User = new ACUser(); ParseOwner(owner, ac); } if (visit != null) { ac.Visit = new ACVisit(); ParseVisit(visit, ac); } ListOfACContent.Add(ac); } } } catch (Exception ex) { ACDEBUG.Print(ex.Message); } }
public override void ParseData(string str) { try { JObject obj = JObject.Parse(str); ListOfACContent = new List <AcContent>(); var msg = obj["message"]; if (msg.ToString().ToUpper() == "OK") { var contents = obj["data"]["contents"].ToList(); foreach (var item in contents) { var ac = new AcContent(); ac.ChannelId = item["channelId"].ToString(); ac.id = item["id"].ToString(); ac.Cover = item["image"].ToString(); ac.Description = item["intro"].ToString(); ac.ReleaseDate = item["releasedAt"].ToString(); ac.Title = item["title"].ToString(); ac.ACURL = item["url"].ToString(); var bangumi = item["latestBangumiVideo"]; var visit = item["visit"]; if (bangumi != null) { ac.Bangumi = new Bangumi(); this.ParseBangumiData(bangumi, ac); } if (visit != null) { ac.Visit = new ACVisit(); base.ParseVisit(visit, ac); } base.ListOfACContent.Add(ac); } } } catch (Exception ex) { ACDEBUG.Print(ex.Message); } }
virtual public void ParseVisit(JToken visit, AcContent ac) { if (ac.Visit == null) { ac.Visit = new ACVisit(); } ac.Visit.Comments = visit["comments"].ToString(); ac.Visit.GoldBanana = visit["goldBanana"].ToString(); ac.Visit.Score = visit["score"].ToString(); ac.Visit.Ups = visit["ups"].ToString(); ac.Visit.Stows = visit["stows"].ToString(); ac.Visit.Views = visit["views"].ToString(); try { ac.Visit.DanmakuSize = visit["danmakuSize"].ToString(); } catch { } }
public async override void ParseData(string str) { try { JObject obj = JObject.Parse(str); var data = obj["data"]; var owner = obj["data"]["owner"]; JEnumerable <JToken> tags = new JEnumerable <JToken>(); var videos = obj["data"]["videos"].ToList(); var visit = obj["data"]["visit"]; base.ListOfACContent = new List <AcContent>(); var ac = new AcContent(); //root data ac.ChannelId = data["channelId"].ToString(); ac.ContentId = data["contentId"].ToString(); ac.Cover = data["cover"].ToString(); ac.Description = data["description"].ToString(); ac.Display = data["display"].ToString(); ac.IsArticle = data["isArticle"].ToString(); ac.ReleaseDate = data["releaseDate"].ToString(); ac.Title = data["title"].ToString(); ac.Toplevel = data["topLevel"].ToString(); ac.UpdatedAt = data["updatedAt"].ToString(); //owner data ac.User = new ACUser(); base.ParseOwner(owner, ac); //tags data ac.Tags = new List <string>(); foreach (var tag in tags) { ac.Tags.Add(tag.ToString()); } //video data ac.DetailVideos = new List <VideoDetail>(); foreach (var video in videos) { var v = new VideoDetail(); v.CommentId = video["commentId"].ToString(); v.DanmakuId = video["danmakuId"].ToString(); v.SourceId = video["sourceId"].ToString(); v.SourceType = video["sourceType"].ToString(); v.StartTime = video["startTime"].ToString(); v.Time = video["time"].ToString(); v.Title = video["title"].ToString(); v.Url = video["url"].ToString(); v.VideoId = video["videoId"].ToString(); // v.VisibleLevel = video["visibleLevel"].ToString(); ac.DetailVideos.Add(v); } //visit data ac.Visit = new ACVisit(); base.ParseVisit(visit, ac); base.ListOfACContent.Add(ac); } catch (Exception ex) { ACDEBUG.Print(ex.Message); } }
public ACArticleData(AcContent content) { this.acContent = content; }
private void TodyTextBlock_Click(object sender, RoutedEventArgs e) { HyperlinkButton clickButton = sender as HyperlinkButton; AcFunVideo.Model.AcContent ac = clickButton.Tag as AcFunVideo.Model.AcContent; }