forked from microsoft/CopilotAdventures
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathThe-Scrolls-Of-Eldoria.cs
38 lines (33 loc) · 1.12 KB
/
The-Scrolls-Of-Eldoria.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System.Net.Http.Headers;
using System.Text.RegularExpressions;
public class Eldoria
{
private static async Task FetchAndDecipherScroll(string url)
{
Console.WriteLine($"Fetching scroll from {url}");
try
{
using (var httpClient = new HttpClient())
{
string scrollContent = await httpClient.GetStringAsync(url);
// Use regular expression to extract the secrets
Regex secretsPattern = new Regex(@"\{\*(.*?)\*\}");
MatchCollection matches = secretsPattern.Matches(scrollContent);
// Display the extracted secrets
foreach (Match match in matches)
{
Console.WriteLine(match.Groups[1].Value);
}
}
}
catch (Exception ex)
{
Console.WriteLine($"An error occurred: {ex.Message}");
}
}
public static void Run()
{
string url = "https://raw.githubusercontent.com/microsoft/CopilotAdventures/main/Data/scrolls.txt";
FetchAndDecipherScroll(url).Wait();
}
}