SHOW:
|
|
- or go back to the newest paste.
1 | internal class GroupScanner | |
2 | { | |
3 | private readonly Random _groupnumberGenerator; | |
4 | ||
5 | public GroupScanner() | |
6 | { | |
7 | _groupnumberGenerator = new Random(); | |
8 | } | |
9 | ||
10 | public void Initialize(int userSpecifiedTaskAmount) | |
11 | { | |
12 | ParallelOptions options = new ParallelOptions(); | |
13 | options.MaxDegreeOfParallelism = userSpecifiedTaskAmount; | |
14 | Parallel.For(0, Int32.MaxValue, options, (p) => | |
15 | { | |
16 | MainScan(); | |
17 | }); | |
18 | } | |
19 | ||
20 | private async void MainScan() | |
21 | { | |
22 | HtmlDocument htmlDocument = new HtmlDocument(); | |
23 | string link = $"https://www.roblox.com/Groups/Group.aspx?gid={_groupnumberGenerator.Next(1300000)}"; | |
24 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(link); | |
25 | ||
26 | using (HttpWebResponse response = (HttpWebResponse)await request.GetResponseAsync()) | |
27 | if (response != null && response.StatusCode == HttpStatusCode.OK) | |
28 | using (StreamReader sr = new StreamReader(response.GetResponseStream())) | |
29 | htmlDocument.LoadHtml(await sr.ReadToEndAsync()); | |
30 | ||
31 | request = null; | |
32 | ||
33 | if (htmlDocument.GetElementbyId("MemberCount") != null | |
34 | && htmlDocument.GetElementbyId("MemberCount").InnerText.Equals("Members: 0")) | |
35 | { | |
36 | if (htmlDocument.GetElementbyId("ctl00_cphRoblox_rbxGroupFundsPane_GroupFunds") != null) | |
37 | { | |
38 | uint amount = uint.Parse(htmlDocument.GetElementbyId("ctl00_cphRoblox_rbxGroupFundsPane_GroupFunds").ChildNodes[3].InnerText, NumberStyles.AllowThousands); | |
39 | if (amount != 0) | |
40 | Console.WriteLine($"Group Link: {link} | Robux: {amount}"); | |
41 | } | |
42 | } | |
43 | } | |
44 | } |