]> fortfriendship.online Git - gnargle.github.io.git/blobdiff - RSSGen/Program.cs
new entry on srb2!!
[gnargle.github.io.git] / RSSGen / Program.cs
index b6c16b016d37622515e7be67bd2e3ae0347e3e7c..12241921f4ea31b9147f0a4d182eed8214a0491c 100644 (file)
@@ -1,4 +1,5 @@
-using RssFeedGenerator;
+using OpenGraphNet;
+using RssFeedGenerator;
 using System;
 using System.Collections.Generic;
 using System.IO;
@@ -76,10 +77,14 @@ myRSS.channel = new rssChannel
 
 foreach (var file in fileInfos)
 {
+    var htmlString = File.ReadAllText(file.FullName);
+    OpenGraph graph = OpenGraph.ParseHtml(htmlString);
+    var publishDate = DateTime.Parse(graph.Metadata["article:published_time"].First());
     var item = new rssChannelItem()
     {
-        title = Path.GetFileNameWithoutExtension(file.Name),
-        pubDate = file.CreationTimeUtc.ToString("r"),
+        title = graph.Title,
+        description = graph.Metadata["og:description"].First(),
+        pubDate = publishDate.ToString("r"),
     };
     if (file.FullName.Contains("entries"))
     {