10 Commits

Author SHA1 Message Date
Дмитрий Шиманский 0fa9a491ae Merge branch 'master' of https://github.com/YaFlay/yaflay.ru 2023-10-22 01:38:17 +03:00
Дмитрий Шиманский 11cc55256f make oembed 2023-10-22 01:38:12 +03:00
Dima YaFlay 998d697622 Update redirect_uris.json 2023-10-21 13:16:12 +03:00
Dima YaFlay 6ff6867b70 Update redirect_uris.json 2023-10-20 18:29:42 +03:00
Dima YaFlay 8b5b7cd352 Update redirect_uris.json 2023-10-20 18:20:17 +03:00
Дмитрий Шиманский 83b8c22acf Merge branch 'master' of https://github.com/YaFlay/yaflay.ru 2023-10-20 18:19:48 +03:00
Дмитрий Шиманский abdf1da3d5 Fix bug 2023-10-20 18:19:44 +03:00
Dima YaFlay 489633a7a6 Update redirect_uris.json 2023-10-20 18:11:26 +03:00
Dima YaFlay 820d8b8f8b Update redirect_uris.json 2023-10-20 18:10:36 +03:00
Dima YaFlay 22851d0465 Update redirect_uris.json 2023-10-20 18:09:20 +03:00
4 changed files with 33 additions and 6 deletions
+5 -1
View File
@@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc;
using System.Net; using System.Net;
using System.Net.Http.Headers; using System.Net.Http.Headers;
using System.Text; using System.Text;
using System.Text.Json;
using System.Text.Json.Nodes; using System.Text.Json.Nodes;
using System.Xml.Schema; using System.Xml.Schema;
@@ -21,7 +22,10 @@ namespace yaflay.ru.Новая_папка
HttpClient client = new(); HttpClient client = new();
HttpResponseMessage getter = await client.GetAsync("https://raw.githubusercontent.com/YaFlay/yaflay.ru/master/redirect_uris.json"); HttpResponseMessage getter = await client.GetAsync("https://raw.githubusercontent.com/YaFlay/yaflay.ru/master/redirect_uris.json");
await Console.Out.WriteLineAsync(await getter.Content.ReadAsStringAsync()); await Console.Out.WriteLineAsync(await getter.Content.ReadAsStringAsync());
JsonNode allFile = JsonNode.Parse(await getter.Content.ReadAsStringAsync()); JsonNodeOptions jsonNodeOptions = new ();
JsonDocumentOptions jsonDocumentOptions = new();
jsonDocumentOptions.AllowTrailingCommas = true;
JsonNode allFile = JsonNode.Parse(await getter.Content.ReadAsStringAsync(), jsonNodeOptions, jsonDocumentOptions);
return (string?)allFile[baseUrl]; return (string?)allFile[baseUrl];
} }
catch (Exception except) catch (Exception except)
+11 -1
View File
@@ -1,22 +1,32 @@
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using HeyRed.OEmbed;
namespace yaflay.ru namespace yaflay.ru
{ {
public class Startup public class Startup
{ {
private readonly IConfiguration configuration; private readonly IConfiguration configuration;
private readonly OEmbedOptions options;
public Startup() public Startup()
{ {
configuration = new ConfigurationBuilder() configuration = new ConfigurationBuilder()
.AddEnvironmentVariables(prefix: "m.") .AddEnvironmentVariables(prefix: "m.")
.AddJsonFile("appsettings.json", optional: true) .AddJsonFile("appsettings.json", optional: true)
.Build(); .Build();
options = new OEmbedOptions()
{
EnableCache = true
};
} }
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddControllers(); services.AddControllers();
services.AddRouting(); services.AddRouting();
services.AddRazorPages(); services.AddRazorPages();
services.AddOEmbed(options =>
{
options.EnableCache = true; // true by default
options.EnsureNotNull();
});
//services.AddDirectoryBrowser(); //services.AddDirectoryBrowser();
+12 -1
View File
@@ -1 +1,12 @@
{ "github": "https://github.com/YaFlay", "bump": "https://discord.gg/bump-1119294432949325955", "shitpost": "https://t.me/yaflay_shitposts", "boosty": "https://boosty.to/yaflay", "storespw": "https://github.com/PoopStore-Team" } {
"github": "https://github.com/YaFlay",
"gh": "https://github.com/YaFlay",
"bump": "https://discord.gg/bump-1119294432949325955",
"shitpost": "https://t.me/yaflay_shitposts",
"boosty": "https://boosty.to/yaflay",
"storespw": "https://github.com/PoopStore-Team",
"gh-team": "https://github.com/PoopStore-Team",
"twitch": "https://twitch.tv/bebra_yaflay",
"patreon": "https://patreon.com/yaflay",
"steam": "https://steamcommunity.com/id/bebra_YaFlay/"
}
+2
View File
@@ -12,6 +12,8 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.1" /> <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.1" />
<PackageReference Include="OEmbed" Version="3.0.0" />
<PackageReference Include="OEmbed.Extensions.Microsoft.DependencyInjection" Version="3.0.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>