Computing OCS and mod_syndication upate times

February 11th, 2003

(originally sent as a personal email, but I’m going to post it here as well)

update: got a respone. basically i was attempting to make things too complicated :(

I was playing with the idea of writing an article about RSS modules, which got me thinking about the syndication module, and its relative obscurity.

Its not entirely surprising thats its obscure, weblogs are the RSS playground right now, and in the realm of personal, whimiscal publishing Conditional GETs are probably a much better solution for discovering new content.

However, I also think mod_syndication labours under relative obscurity because it confuses people. And I thought I might do something about that, but now I’ve got a couple of questions about the spec as well.

update: now with answers!

Optionality?

In the OCS format all the fields are optional. In modsyndication it iss ambigous whether updateBase is optional. As updateBase seems to be the most abused field, and adds considerable complexity to calculating update times, it would seem like a good idea to explicit state that is optional, as well as give examples of modsyndication being used without it. (or perhaps it isn’t optional?)

answer: updateBase is optional, but highly reccomended for accuracy

updateBase?

What is the reccomended best practice with updateBase? Do I stick it at some arbitrary point in the past to calculate against? Or should it be set to the most recent publish?

answer: this should stay fixed unless you have an erratic publishing schedule

updateFrequency?

answer (translated): there are no discrete units, everything can be decomposed to seconds

If my updatePeriod is weekly, and my updateFrequency is 2, then does that mean I’m publishing every 3.5 days? (84 hours?)
yes

If for example, I had an updateBase of 2003-02-01T08:00Z, an updatePeriod of Weekly, and an updateFrequency of 2, would this mean, that I’m claiming to publish every Saturday at 8am, and every Wednesday at 8pm?
yes

It probably makes sense to calculate the day change, and then ignore the time change. But it should be defined.
no, days aren’t discrete

For that matter, is twice a month defined at 15 days? or DAY_IN_MONTH/2? On Feb 28th, should I be checking back in 14 days? on 15.5?
DAY_IN_MONTH/2, months are merely composed of days (which are composed of seconds)

It would seem that best practice would dictate using an updateBase for long update frequencies like monthly, or yearly.

Whats a week?

Ignoring all the previous weirdness, if someone has the very simple and reasonable updatePeriod:weekly, with no updateBase, and the assumed updateFrequency of 1. Now is that a week? Or 7 days?

answer: A week is 7 days which is 604800 seconds

For example, its Saturday. Do I come back next Saturday? or do I come back on Monday? or on Sunday?
Saturday

In iCalendar if I ask for a weekly repeat, without specifiying a BYDAY, its going to repeat on Monday, and therefore I should come back 2 days from now.
(note to self, you are a calendar geek)

Either way works, it just needs to be defined.

Code

Do you know of any existing implementations that caculate OCS, or mod_syndication offsets? Code is an excellent way to codify assumptions both explicit and implicity.

update: code is supereasy given the above answers

Tagged: Uncategorized , ,

Comments are closed.