Skip to content

Instantly share code, notes, and snippets.

@LeftofZen
Created January 9, 2023 13:59
Show Gist options
  • Save LeftofZen/89382609801e5adbc3fec6826a0d9f80 to your computer and use it in GitHub Desktop.
Save LeftofZen/89382609801e5adbc3fec6826a0d9f80 to your computer and use it in GitHub Desktop.
rsforum_scraper_for_aussies
using System.Net;
using System.Text.RegularExpressions;
while (true)
{
Console.WriteLine("scraping");
using WebClient client = new();
var url = @$"https://secure.runescape.com/m=forum/forums?320,321,123,65921801,goto,9999";
string html = client.DownloadString(url);
var regex = Regex.Match(html, "<span class=\"forum-post__body\">(.*)<\\/span>");
foreach (var match in regex.Groups.Values)
{
var str = match.Captures.First().Value;
if (Regex.Match(str, "AEST|AEDT|Australia|Aus|Aussie").Success)
{
Console.WriteLine("aussie found");
Console.WriteLine(str);
}
}
Thread.Sleep(10_000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment