public override ComicLocation GetLocation(DateTime now) { var comicContent = this.GetContent(new Uri("http://www.dilbert.com/")); var match = Regex.Match(comicContent, @"img-comic"".* src=""([^""]+)"""); return(match.Success ? ComicLocation.FoundAt(match.Groups[1].Value) : ComicLocation.NotFound); }
public override ComicLocation GetLocation(DateTime now) { var comicContent = this.GetContent($"https://www.comicskingdom.com/{this.name}/{now.ToString("yyyy'-'MM'-'dd")}/"); var match = Regex.Match(comicContent, @"property=""og:image"" content=""([^""]+)"""); return(match.Success ? ComicLocation.FoundAt(match.Groups[1].Value) : ComicLocation.NotFound); }
public override ComicLocation GetLocation(DateTime now) { var comicContent = this.GetContent($"http://www.gocomics.com/{name}/{now.ToString("yyyy'/'MM'/'dd")}/"); var isWrongDay = comicContent.Contains("<h4 class=\"card-title\">Today's Comic from"); if (isWrongDay) { return(ComicLocation.NotPublished); } var imageMatch = Regex.Match(comicContent, @"item-comic-image"".* data-srcset=""([^ ]+) "); return(imageMatch.Success ? ComicLocation.FoundAt(imageMatch.Groups[1].Value) : ComicLocation.NotFound); }