public PageReactionInfo getAllInfo() { PageReactionInfo postInfo = new PageReactionInfo(); foreach (var post in listAllPosts) { dynamic result = client.Get("v2.11/" + post.id + "?fields=reactions.type(LIKE).summary(total_count).limit(0).as(like),reactions.type(LOVE).summary(total_count).limit(0).as(love), reactions.type(WOW).summary(total_count).limit(0).as(wow), reactions.type(HAHA).summary(total_count).limit(0).as(haha), reactions.type(SAD).summary(total_count).limit(0).as(sad), reactions.type(ANGRY).summary(total_count).limit(0).as(angry), reactions.type(THANKFUL).summary(total_count).limit(0).as(thankful)"); postInfo.TotalLike += result.like.summary.total_count; postInfo.TotalLove += result.love.summary.total_count; postInfo.TotalWow += result.wow.summary.total_count; postInfo.TotalHaha += result.haha.summary.total_count; postInfo.TotalSad += result.sad.summary.total_count; postInfo.TotalAngry += result.angry.summary.total_count; postInfo.TotalThankful += result.thankful.summary.total_count; } return(postInfo); }
public async Task setlabels() { await Task.Delay(0); PageReactionInfo postInfo1 = new PageReactionInfo(); postInfo1 = getAllInfo(); lblTotalLikes.Text = postInfo1.TotalLike.ToString(); lblTotalLove.Text = postInfo1.TotalLove.ToString(); lblTotalWow.Text = postInfo1.TotalWow.ToString(); lblTotalHaha.Text = postInfo1.TotalHaha.ToString(); lblTotalSad.Text = postInfo1.TotalSad.ToString(); lblTotalAngry.Text = postInfo1.TotalAngry.ToString(); lblTotalThanks.Text = postInfo1.TotalThankful.ToString(); GC.Collect(); }
public List <PageReactionInfo> getAllPostInfo() { foreach (var post in listAllPosts) { PageReactionInfo postInfo = new PageReactionInfo(); dynamic result = client.Get("v2.11/" + post.id + "?fields=reactions.type(LIKE).summary(total_count).limit(0).as(like),reactions.type(LOVE).summary(total_count).limit(0).as(love), reactions.type(WOW).summary(total_count).limit(0).as(wow), reactions.type(HAHA).summary(total_count).limit(0).as(haha), reactions.type(SAD).summary(total_count).limit(0).as(sad), reactions.type(ANGRY).summary(total_count).limit(0).as(angry), reactions.type(THANKFUL).summary(total_count).limit(0).as(thankful)"); postInfo.TotalLike = result.like.summary.total_count; postInfo.TotalLove = result.love.summary.total_count; postInfo.TotalWow = result.wow.summary.total_count; postInfo.TotalHaha = result.haha.summary.total_count; postInfo.TotalSad = result.sad.summary.total_count; postInfo.TotalAngry = result.angry.summary.total_count; postInfo.TotalThankful = result.thankful.summary.total_count; postInfo.Id = 1; postInfo.PostId = post.id; postInfo.DateTime = DateTime.Now; listAllPostsInfo.Add(postInfo); } return(listAllPostsInfo); }