Use file-scoped namespaces

This commit is contained in:
Andriy
2023-07-29 15:14:52 +03:00
parent a24332370d
commit 8ab067a027
58 changed files with 2222 additions and 2280 deletions
+16 -17
View File
@@ -2,27 +2,26 @@ using System.Threading.Tasks;
using Fizzler.Systems.HtmlAgilityPack;
using HtmlAgilityPack;
namespace Kruzya.TelegramBot.Destiny2.WhereIsXur.Provider
namespace Kruzya.TelegramBot.Destiny2.WhereIsXur.Provider;
public class XurWiki : IXurPlaceProvider
{
public class XurWiki : IXurPlaceProvider
public async Task<string> GetPlaceAsync()
{
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)
{
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 "";
return place.InnerText.Trim();
}
public string GetPlace()
{
return GetPlaceAsync().GetAwaiter().GetResult();
}
return "";
}
public string GetPlace()
{
return GetPlaceAsync().GetAwaiter().GetResult();
}
}