-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSearchURL.cs
More file actions
42 lines (36 loc) · 1019 Bytes
/
SearchURL.cs
File metadata and controls
42 lines (36 loc) · 1019 Bytes
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
39
40
41
42
using System.Text;
using System.Threading.Tasks;
using HtmlAgilityPack;
using System.Net.Http;
using System.Net.Http.Headers;
using System.IO;
using Microsoft.AspNetCore.Mvc;
namespace SpotifyBot
{
internal class SearchURL
{
public SearchURL(string reasearch)
{
string research = reasearch;
}
private static async Task<string> CallUrl(string fullUrl)
{
HttpClient client = new HttpClient();
var response = await client.GetStringAsync(fullUrl);
return response;
}
public string Test(string research)
{
string url = "https://open.spotify.com/" + research;
var response = CallUrl(url).Result;
return response;
}
/*
public IActionResult Index(string research)
{
string url = "open.spotify.com/" + research;
var response = CallUrl(url).Result;
return View();
}*/
}
}