惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

小众软件
小众软件
量子位
阮一峰的网络日志
阮一峰的网络日志
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
美团技术团队
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
腾讯CDC
V
Visual Studio Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 三生石上(FineUI控件)
IT之家
IT之家
博客园 - 【当耐特】
L
LangChain Blog
A
About on SuperTechFans
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
N
Netflix TechBlog - Medium
博客园_首页
WordPress大学
WordPress大学
博客园 - Franky
Engineering at Meta
Engineering at Meta
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
M
MIT News - Artificial intelligence

John Bokma's Hacking and Hiking

Setting up a Brother AirPrinter on Ubuntu Failed to verify signature archive-contents.sig in Emacs Aquamacs 3.6 Hangs When Saving An Encrypted File PAR trouble How To Create a Bootable LibreELEC Installation using Mac OS Running pdflatex Using the Alpine Pandoc LaTeX Docker Image A Docker Image for Sass Timezones in Alpine Docker Containers A Tale of Three Docker Images Debugging a Perl Docker container Perl Time::Piece Unicode Issue Giving Docker Desktop for macOS a Second Chance Flashing another TP-Link TL-WDR4300 with OpenWrt firmware Rehousing two tarantulas Getting started with the Perl version of tumblelog on Ubuntu 18.04 LTS A visit to Avonturia De Vogelkelder Flashing a TP-Link TL-WDR4300 with OpenWrt firmware Mounting a VDI File in a Different VirtualBox Guest Wireless Headless Raspberry Pi - John Bokma Hand coding an RSS 2.0 feed in Python RFC #822 and RFC #3339 dates in Perl RFC #822 and RFC #3339 dates in Python Hand coding an RSS 2.0 feed in Perl Nav Element with no Heading Rewriting CommonMark Nodes in Perl "right" this time
A Matter of Time - John Bokma
John Bokma · 2019-10-10 · via John Bokma's Hacking and Hiking

October 9, 2019

Several weeks ago, when I started to add a JSON feed to tumblelog I had to consider what time stamp to use for date_published. As I blog often more than once during the day, and all such entries end up on the same page, there is no specific publication time to assign to such a page. Well, technically I could keep track of the last time the page was modified, but that would make tumblelog more complex, and I like to keep it a simple program. And while date_published is optional in a JSON feed I preferred to give it a value.

So, at first I just set date_published to just the date of the day I had published the blog entries on. Last week, when validating the JSON feed I learned that that's not a valid value for date_published; oops.

Also last week, upon reading the RSS specification, another more known feed format, I noticed the following note associated with the pubDate sub-element:

Its value is a date, indicating when the item was published. If it's a date in the future, aggregators may choose to not display the item until that date.

This led me to the idea of using the end of the day as the publication date. Or: I blog during the day, and at the end of the day all entries are considered published.

This decided I started to add RSS feed support to both the Perl and Python version of tumblelog.

The only downside, so far, is that the Feed Validator reports for the RSS feed:

This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.

  • line 1, column 502: Implausible date: Wed, 09 Oct 2019 23:59:59 +0200

I tested both the JSON feed and RSS feed in Reeder and NetNewsWire on macOS Mojave and both have no problem handling the feeds of my tumblelog Plurrrr.

After having decided to use the end of the day as publication time came the next task: encoding the local date and time in the correct format. A JSON feed uses RFC #3339 while RSS uses RFC #822.