Example #1
0
        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);
            }
        }
Example #2
0
        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);
            }
        }
Example #3
0
        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);
        }
Example #4
0
 public void InsertOrUpdateHumaniodTag(IHumanoidTag humanoidTag)
 {
     throw new System.NotImplementedException();
 }
Example #5
0
 private void HashtagFound(IHumanoidTag tag)
 {
     this.OnHashtagFound?.Invoke(tag);
 }