public Dictionary <string, string> fetchAnimeList()
{
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("https://horriblesubs.info/shows/");
string htmlPage;
using (HttpWebResponse response = (HttpWebResponse)req.GetResponse())
using (Stream stream = response.GetResponseStream())
using (StreamReader reader = new StreamReader(stream))
{
htmlPage = reader.ReadToEnd();
}
Dictionary <string, string> animeDictionary = new Dictionary <string, string>();
if (!String.IsNullOrEmpty(htmlPage))
{
string pattern = "<div class=\"ind-show\"><a href=\"(?<url>.*?)\" title=\"(?<title>.*?)\">[\\s\\S].*?</a></div>";
MatchCollection m = Regex.Matches(htmlPage, pattern);
foreach (Match match in m)
{
animeDictionary.Add(match.Groups["title"].Value, match.Groups["url"].Value);
}
}
return(animeDictionary);
}