change yaflay.ru to yawaflua.ru in oembed and add pushup message

This commit is contained in:
Дмитрий Шиманский
2023-11-10 17:39:38 +03:00
parent a4bd0eba1a
commit e6d084f78c
4 changed files with 36 additions and 17 deletions

View File

@@ -11,26 +11,25 @@ namespace yaflay.ru.Новая_папка
{
// GET: HomeController
private async Task<string?> getUrlFromGit(string baseUrl)
{
try
{
HttpClient client = new();
HttpResponseMessage getter = await client.GetAsync("https://raw.githubusercontent.com/YaFlay/yaflay.ru/master/redirect_uris.json");
JsonNodeOptions jsonNodeOptions = new ();
JsonDocumentOptions jsonDocumentOptions = new()
HttpResponseMessage getter = await client.GetAsync("https://raw.githubusercontent.com/yawaflua/yaflay.ru/master/redirect_uris.json");
JsonDocumentOptions jsonDocumentOptions = new ()
{
AllowTrailingCommas = true
};
JsonNode? allFile = JsonNode.Parse(await getter.Content.ReadAsStringAsync(),
nodeOptions: jsonNodeOptions,
documentOptions: jsonDocumentOptions);
;
return (string?)allFile[baseUrl];
}
catch (Exception except)
{
await Console.Out.WriteLineAsync(except.ToString());
await Console.Out.WriteLineAsync(except.Message.ToString());
return null;
}
}
@@ -40,7 +39,6 @@ namespace yaflay.ru.Новая_папка
{
string? url = await getUrlFromGit(uri);
await Console.Out.WriteLineAsync($"New connected user: {HttpContext.Connection.RemoteIpAddress}");
if (url != null)
{
return Redirect(url);

View File

@@ -1,7 +1,7 @@
@page
@model IndexModel
@{
ViewData["Title"] = "YaFlay";
ViewData["Title"] = "yawaflua";
}
<h3 align="left" class="readme" >README.md</h3>
@@ -9,5 +9,6 @@
@{
string Github_readme = Startup.client.GetStringAsync("https://raw.githubusercontent.com/yawaflua/yawaflua/main/README.md").Result;
<div class="text"> @Html.Raw(Github_readme) </div>
}

View File

@@ -4,13 +4,14 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="~/favicon.ico" />
<title>@ViewData["Title"] - yaflay.ru</title>
<title>@ViewData["Title"] - @Context.Request.Host.Host</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
<link type="application/json+oembed" href="~/json/oembed.json" />
<!--<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">-->
<meta property="og:title" content="YaFlay ReadMe" />
<meta property="og:type" content="rich" />
<meta property="og:url" content="https://yaflay.ru/" />
<meta property="og:url" content="@Context.Request.Host.Host" />
<meta property="og:image" content="https://user-images.githubusercontent.com/5713670/87202985-820dcb80-c2b6-11ea-9f56-7ec461c497c3.gif" />
<meta property="og:description"
content="Here you can check info about YaFlay: social networks, programming languages that he knows and his projects." />
@@ -21,16 +22,16 @@
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light border-bottom box-shadow mb-3" style="background-color: #2c2c2c;">
<div class="container">
<a class="navbar-brand" style="color: cornflowerblue" asp-area="" asp-page="/Index">
<img src="https://cdn.discordapp.com/avatars/945317832290336798/fcd69146cf424ca9b6e507bba67386ab.gif" width="50" height="50" style="border-radius: 10px; margin-right: 10%">
yaflay.ru
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
<ul class="navbar-nav flex-grow-1">
<a class="nav-link " style="color: cornflowerblue;" asp-area="" asp-page="/Index">
@Context.Request.Host.Host
</a>
<li class="nav-item">
<a class="nav-link text-white" asp-area="" asp-page="/Index">Home</a>
</li>
@@ -45,6 +46,25 @@
</div>
</nav>
</header>
<div class="migratePushUp">
@{
if (!Context.Request.Host.Host.StartsWith("yawaflua.ru"))
{
<div aria-live="polite" aria-atomic="true" style="margin-right: 3vh;">
<div class="toast" style="position: fixed; bottom: 0; right: 0; display:block;">
<div class="toast-header" >
<strong class="mr-auto" style="left: 1%; position:absolute;">@Context.Request.Host.Host</strong>
<small style="right: 1%; position:absolute; ">Now</small>
</div>
<div class="toast-body" style="color:black;">
This site is outdated. Use <a href="https://yawaflua.ru">new site</a>
</div>
</div>
</div>
}
}
</div>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
@@ -53,7 +73,7 @@
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2023 - yaflay.ru - <a asp-area="" asp-page="/Privacy">Privacy</a>
&copy; 2023 - @Context.Request.Host.Host - <a asp-area="" asp-page="/Privacy">Privacy</a>
</div>
</footer>

View File

@@ -2,9 +2,9 @@
"embeds": [
{
"type": "rich",
"url": "yaflay.ru",
"title": "YaFlay ReadMe",
"description": "Here you can get info about YaFlay: social networks, programming languages that he knows and his projects.",
"url": "yawaflua.ru",
"title": "ReadAbout yawaflua",
"description": "Here you can get info about yawaflua: social networks, programming languages that he knows and his projects.",
"thumbnail": {
"url": "https://user-images.githubusercontent.com/5713670/87202985-820dcb80-c2b6-11ea-9f56-7ec461c497c3.gif",
"proxy_url": "https://user-images.githubusercontent.com/5713670/87202985-820dcb80-c2b6-11ea-9f56-7ec461c497c3.gif",