mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
28 lines
718 B
C#
28 lines
718 B
C#
|
|
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();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|