13 Commits

Author SHA1 Message Date
Дмитрий Шиманский ebc91f07da delete oembed and fix robots.txt 2023-10-22 13:13:17 +03:00
Дмитрий Шиманский b3b570f56e rework oembed, because he didn`t work as well 2023-10-22 13:10:43 +03:00
Дмитрий Шиманский 5471ad08ba add providers to oembed, add robots.txt 2023-10-22 01:51:58 +03:00
Дмитрий Шиманский 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
7 changed files with 60 additions and 19 deletions
+10 -11
View File
@@ -1,11 +1,6 @@
using Microsoft.AspNetCore.Hosting.StaticWebAssets;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Net;
using System.Net.Http.Headers;
using System.Text;
using Microsoft.AspNetCore.Mvc;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Xml.Schema;
namespace yaflay.ru.Новая_папка
{
@@ -21,7 +16,10 @@ namespace yaflay.ru.Новая_папка
HttpClient client = new();
HttpResponseMessage getter = await client.GetAsync("https://raw.githubusercontent.com/YaFlay/yaflay.ru/master/redirect_uris.json");
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];
}
catch (Exception except)
@@ -36,11 +34,12 @@ namespace yaflay.ru.Новая_папка
public async Task<IActionResult> fromGitHub(string? uri)
{
if (uri == "Robots.txt") { return Ok("User-Agent: * \n Disallow: \"/*\""); }
if (uri == "Robots.txt") { return Ok("User-Agent: * \n Disallow: /*"); }
string? url = await getUrlFromGit(uri);
return Redirect(url != null ? url : uri);
await Console.Out.WriteLineAsync(url == null ? "Null" : $"notNull {url}");
return Redirect(url ?? "https://yaflay.ru/");
}
// GET: HomeController/Create
+9
View File
@@ -0,0 +1,9 @@
@page
@{
Layout = null;
this.Response.ContentType = "text/plain";
}
# /robots.txt file for http://www.hanselman.com/
User-agent: *
<environment include="Development,Staging">Disallow: /</environment>
<environment include="Production">Disallow: /* </environment>
+2 -1
View File
@@ -6,7 +6,8 @@
<title>@ViewData["Title"] - yaflay.ru</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
<link rel="stylesheet" href="~/yaflay.ru.styles.css" asp-append-version="true" />
<!-- <link rel="stylesheet" href="~/yaflay.ru.styles.css" asp-append-version="true" /> --!/>
<link type="application/json+oembed" href="~/json/oembed.json" />
</head>
<body>
<header>
+7 -2
View File
@@ -1,5 +1,4 @@
using Microsoft.Extensions.Options;
namespace yaflay.ru
{
public class Startup
@@ -11,12 +10,18 @@ namespace yaflay.ru
.AddEnvironmentVariables(prefix: "m.")
.AddJsonFile("appsettings.json", optional: true)
.Build();
}
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
services.AddRouting();
services.AddRazorPages();
services.AddMvc()
.AddRazorPagesOptions(options =>
{
options.Conventions.AddPageRoute("/robots.txt", "/RobotsTxt");
});
//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/"
}
+16
View File
@@ -0,0 +1,16 @@
{
"embeds": [
{
"type": "link",
"url": "https://yaflay.ru/",
"title": "YaFlay ReadMe",
"description": "Here you can learn about YaFlay: social networks, programming languages that he knows and his projects.",
"thumbnail": {
"url": "https://avatars.githubusercontent.com/u/93622229?v=4",
"proxy_url": "https://avatars.githubusercontent.com/u/93622229?v=4",
"width": 1200,
"height": 1200
}
}
]
}
+1 -1
View File
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.6.33723.286
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "yaflay.ru", "yaflay.ru.csproj", "{3AA2FE9B-D1AF-4B12-B090-7E4529BA40E0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "yaflay.ru", "yaflay.ru.csproj", "{3AA2FE9B-D1AF-4B12-B090-7E4529BA40E0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution