mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
Where is Xur?
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System.Threading.Tasks;
|
||||
using Fizzler.Systems.HtmlAgilityPack;
|
||||
using HtmlAgilityPack;
|
||||
|
||||
namespace Kruzya.TelegramBot.Destiny2.WhereIsXur.Provider
|
||||
{
|
||||
public class XurWiki : IXurPlaceProvider
|
||||
{
|
||||
public async Task<string> GetPlaceAsync()
|
||||
{
|
||||
var web = new HtmlWeb();
|
||||
var document = await web.LoadFromWebAsync("https://xur.wiki");
|
||||
|
||||
var place = document.DocumentNode.QuerySelector(".location_name");
|
||||
if (place != null)
|
||||
{
|
||||
return place.InnerText.Trim();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public string GetPlace()
|
||||
{
|
||||
return GetPlaceAsync().GetAwaiter().GetResult();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user