public static async Task <string> GetReview(string author = "") { try { if (author == "") { author = Properties.Resources.ReviewAuthor; } HtmlWeb web = new HtmlWeb(); HtmlDocument doc = web.Load(nintendoUrl); var reviewsUrls = doc.DocumentNode.SelectNodes("//div[@class='main-wrapper-text']/a"); foreach (var item in reviewsUrls) { if (WebScraping.Find(author, item.Attributes["href"].Value) == true) { return($"{author}\n" + item.Attributes["href"].Value); } } await Task.CompletedTask; return($"Found... nothing... {author} is lazy..."); } catch (Exception e) { return(e.Message); } }
public async Task GetReview([Remainder] string author = "") { await Context.Channel.SendMessageAsync(await WebScraping.GetReview(author)); }