]> fortfriendship.online Git - gnargle.github.io.git/commitdiff
skeleton new entry, make rssgen platform agnostic (bin output folder is based on...
authorAthene Allen <atheneallen93@gmail.com>
Thu, 27 Feb 2025 22:08:57 +0000 (22:08 +0000)
committerAthene Allen <atheneallen93@gmail.com>
Thu, 27 Feb 2025 22:08:57 +0000 (22:08 +0000)
RSSGen/Program.cs
diversions/hentaigames.html [new file with mode: 0644]

index 12241921f4ea31b9147f0a4d182eed8214a0491c..dde1a5207ff68812309252ff46f474852e8d8d24 100644 (file)
@@ -8,16 +8,8 @@ using System.Runtime.InteropServices;
 // See https://aka.ms/new-console-template for more information
 Console.WriteLine("Scanning entries folder for latest files");
 
-var folder = String.Empty;
+var folder = FindDirectory("entries");
 
-if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
-{
-    folder = Path.Combine(Directory.GetCurrentDirectory(), "../entries");
-}
-else
-{
-    folder = Path.Combine(Directory.GetCurrentDirectory(), "../../../../entries");
-}
 var filePaths = Directory.EnumerateFiles(folder);
 var fileInfos = new List<FileInfo>();
 
@@ -34,15 +26,23 @@ if (filePaths.Any())
 
 Console.WriteLine("Scanning projects folder for latest files");
 
-if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
-{
-    folder = Path.Combine(Directory.GetCurrentDirectory(), "../projects");
-}
-else
+folder = FindDirectory("projects");
+
+filePaths = Directory.EnumerateFiles(folder);
+
+if (filePaths.Any())
 {
-    folder = Path.Combine(Directory.GetCurrentDirectory(), "../../../../projects");
+    foreach (var path in filePaths)
+    {
+        var fInfo = new FileInfo(path);
+        fileInfos.Add(fInfo);
+    }
 }
 
+Console.WriteLine("Scanning diversions folder for latest files");
+
+folder = FindDirectory("diversions");
+
 filePaths = Directory.EnumerateFiles(folder);
 
 if (filePaths.Any())
@@ -54,7 +54,7 @@ if (filePaths.Any())
     }
 }
 
-fileInfos = fileInfos.OrderByDescending(f => f.CreationTimeUtc).Take(10).ToList();
+fileInfos = fileInfos.OrderByDescending(f => f.CreationTimeUtc).Take(20).ToList();
 
 var myRSS = new rss();
 
@@ -94,6 +94,10 @@ foreach (var file in fileInfos)
     {
         item.link = "https://athene.gay/projects/" + Path.GetFileName(file.Name);
     }
+    else if (file.FullName.Contains("diversions"))
+    {
+        item.link = "https://athene.gay/diversions/" + Path.GetFileName(file.Name);
+    }
     item.guid = new rssChannelItemGuid()
     {
         isPermaLink = true,
@@ -104,13 +108,9 @@ foreach (var file in fileInfos)
 
 var output = Generator.SerializeRSS(myRSS);
 
-var rssPath = String.Empty;
+var rssPath = Path.Combine(Directory.GetCurrentDirectory(), "../feed.xml");
 
-if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
-{
-    rssPath = Path.Combine(Directory.GetCurrentDirectory(), "../feed.xml");
-}
-else
+if (!File.Exists(rssPath))
 {
     rssPath = Path.Combine(Directory.GetCurrentDirectory(), "../../../../feed.xml");
 }
@@ -123,4 +123,14 @@ if (File.Exists(rssPath))
 Console.WriteLine("RSS generated, outputting to console and file");
 Console.WriteLine(output);
 
-File.WriteAllText(rssPath, output);
\ No newline at end of file
+File.WriteAllText(rssPath, output);
+
+string FindDirectory(string folderName)
+{
+    var folder = Path.Combine(Directory.GetCurrentDirectory(), $"../{folderName}");
+    if (!Directory.Exists(folder))
+    {
+        folder = Path.Combine(Directory.GetCurrentDirectory(), $"../../../../{folderName}");
+    }
+    return folder;
+}
\ No newline at end of file
diff --git a/diversions/hentaigames.html b/diversions/hentaigames.html
new file mode 100644 (file)
index 0000000..6e5d9a4
--- /dev/null
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="UTF-8" />
+    <title>The Life and Death(ish) of Hentai Games</title>
+    <meta
+      property="og:title"
+      content="The Life and Death(ish) of Hentai Games"
+    />
+    <meta
+      name="twitter:title"
+      content="The Life and Death(ish) of Hentai Games"
+    />
+    <meta
+      name="description"
+      content="Once upon a time, I was a horny teenage boy. Now, I'm a horny adult woman."
+    />
+    <meta
+      property="og:description"
+      content="Once upon a time, I was a horny teenage boy. Now, I'm a horny adult woman."
+    />
+    <meta
+      name="twitter:description"
+      content="Once upon a time, I was a horny teenage boy. Now, I'm a horny adult woman."
+    />
+    <meta
+      property="article:published_time"
+      content="2025-02-27T00:00:00+00:00"
+    />
+    <link rel="stylesheet" href="../main.css" />
+  </head>
+  <body class="whole-site">
+    <div>
+      <iframe class="embed-title" src="../shared/title.html"> </iframe>
+      <div class="main-container">
+        <div class="main">
+          <div class="entry">
+            <a href="../index.html">Home</a>
+            <div class="title-block">
+              <h3 class="blog-title">
+                The Life and Death(ish) of Hentai Games
+              </h3>
+              <h3 class="datestamp">27/02/2025</h3>
+            </div>
+            <div class="content">
+              <p>
+                Once upon a time, I was a horny teenage boy. Now, I'm a horny
+                adult woman.
+              </p>
+            </div>
+          </div>
+        </div>
+      </div>
+      <iframe class="embed-links" src="../shared/links.html"> </iframe>
+      <iframe class="embed-footer" src="../shared/footer.html"> </iframe>
+    </div>
+  </body>
+</html>