diff options
-rwxr-xr-x | rss.rb | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -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}>" |