summary refs log tree commit diff
diff options
context:
space:
mode:
authorpdp8 <pdp8@pdp8.info>2024-02-24 11:19:13 +0100
committerpdp8 <pdp8@pdp8.info>2024-02-24 11:19:13 +0100
commit4bd4cb578ee4579eaa81efec4b478654fae8e236 (patch)
tree4772493d8c1ff842c2aadcbb00cf326620be3728
parentbf07c1fae9aa107e98fd87064f6112d575e79a34 (diff)
rss.rb: dc:date removed, guid added
-rwxr-xr-xrss.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/rss.rb b/rss.rb
index 47b47c0..554d45c 100755
--- a/rss.rb
+++ b/rss.rb
@@ -10,9 +10,10 @@ items = []
     items << {
       title: File.basename(dir).split('_')[1..-1].join(' '),
       link: File.join('https://pdp8.info', cat + '.html#' + date),
+      guid: File.join('https://pdp8.info', cat + '.html#' + date),
       description: File.read(File.join(dir, 'README')).chomp.sub(/^\n/, '').sub("\n\n", "\n"),
-      pubDate: updated.httpdate,
-      'dc:date' => updated.rfc3339
+      pubDate: updated.httpdate
+      # 'dc:date' => updated.rfc3339
     }
   end
 end
@@ -21,14 +22,14 @@ updated = Date.parse(date) # .strftime('%Y%m%d')
 items << {
   title: 'pictures',
   link: 'https://pdp8.info/pictures.html',
-  pubDate: updated.httpdate,
-  'dc:date' => updated.rfc3339
+  guid: 'https://pdp8.info/pictures.html',
+  pubDate: updated.httpdate
+  # 'dc:date' => updated.rfc3339
 }
 
 xml = ['<?xml version="1.0" encoding="UTF-8"?>
 <rss version="2.0"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
-  xmlns:dc="http://purl.org/dc/elements/1.1/">
   <channel>
     <title>pdp8</title>
     <link>https://pdp8.info</link>
@@ -36,9 +37,9 @@ xml = ['<?xml version="1.0" encoding="UTF-8"?>
     <language>en</language>']
 date = DateTime.now
 xml << "    <pubDate>#{date.httpdate}</pubDate>"
-xml << "    <dc:date>#{date.rfc3339}</dc:date>"
+# xml << "    <dc:date>#{date.rfc3339}</dc:date>"
 
-items.sort_by { |i| i['dc:date'] }.each do |item|
+items.sort_by { |i| i['pubDate'] }.each do |item|
   xml << '    <item>'
   item.each do |k, v|
     xml << "      <#{k}>#{v}</#{k}>"