public void InsertOrUpdateHumaniodTag(IHumanoidTag humanoidTag) { humanoidTag.Name = humanoidTag.Name.ToLower(); var existingITag = this.allHumanoidTags.FirstOrDefault(x => x.Name == humanoidTag.Name); if (existingITag != null) { if (existingITag.Posts == humanoidTag.Posts) { return; } existingITag.Posts = humanoidTag.Posts; this.Db.HumanoidTags.Update(existingITag); this.Save(); } else { var itag = new EntityFrameworkHumanoidTags { Name = humanoidTag.Name, Posts = humanoidTag.Posts }; this.Db.HumanoidTags.Add(itag); this.Save(); this.allHumanoidTags.Add(itag); } }
private void HashtagFound(IHumanoidTag hTag) { this.db.InsertOrUpdateHumaniodTag(hTag); var exists = this.allHTags.FirstOrDefault(htag => htag.Name == hTag.Name); if (exists == null) { this.allHTags.Add(hTag); } }
private (int, List <string>) ExploreTagsCrawlerFunc(IHumanoidTag tag) { var url = $"https://www.instagram.com/explore/tags/{tag.Name}/"; (var amountPosts, var images) = this.exploreTagsPageCrawler.Parse(url); var shortcodes = new List <string>(); if (images != null) { foreach (var image in images) { shortcodes.Add(image.Shortcode); } } return(amountPosts, shortcodes); }
public void InsertOrUpdateHumaniodTag(IHumanoidTag humanoidTag) { throw new System.NotImplementedException(); }
private void HashtagFound(IHumanoidTag tag) { this.OnHashtagFound?.Invoke(tag); }