Ir al contenido principal

Ralsina.Me — El sitio web de Roberto Alsina

KRsN looking good

I left it work­ing and fetch­ing overnight, and it has­n't crashed. It even seems to have got all the items from about 12 feeds with­out prob­lems :-)

If any­one wants to give it a try, CVS from source­forge has all the stuff. It can't be in­stalled yet, though, just use it from its own fold­er.

Everything that happens has already happened

And some­one post­ed it on the in­ter­net.

So, the RSS date stuff I men­tioned? Mark Pil­gim al­ready fixed it with rss­find­er's parse_http_­date func­tion.

Ahh, the pleasure of coding.

And I mean it lit­er­al­ly this time.

I just had 6 hours of straight sol­id cod­ing (KRsN, if you are in­ter­est­ed), and I feel great.

I can't even re­mem­ber the last time I did this. But hey, at least now KRsN has a semi-de­cent da­ta han­dling, should­n't lock on the DB much (I still have some con­cept prob­lems there), and should pret­ty much work, as long as you don't take its mul­ti­thread­ing too se­ri­ous­ly.

And the real problem is...

That date pars­ing is aw­ful. Yes, I can just try strp­ti­me() with dif­fer­ent for­mats un­til one work­s, but look at this:

from time import *
Traceback (most recent call last):
  File "stdin", line 1, in ?
ValueError: unconverted data remains: 'ART'

Now, what that is sup­posed to do, as far as I un­der­stand, is print my time­zone (that is the strf­time cal­l, it prints ART), and then parse it back (that is the strp­time cal­l, and it fail­s).

Maybe %Z is new... no, it is­nt. It is in the ref­er­ence guide for 2.2.2 (what I use).

RSS parsing...

Now, how is a RSS ag­gre­ga­tor sup­posed to sort these things by date?

  • Tue, 07 Oct 2003 23:09:52 GMT

  • 20010627T12:40:33

the first ok for a hu­man, but for a com­put­er it is not, vicev­er­sa for the sec­ond :-P

Sad­ly, that is what PyCS and ad­voga­to re­turn in the date field of RSS feed­s.

So, the client is forced to as­sume that:

  • That thing must be read­­able some­how for the user, and cant for­­mat it (I try to parse for the ad­vo­ga­­to for­­mat, when it does­nt work I leave it as is)

  • Items cant be sort­ed by date cross-feed (ie: give me the lat­est posts from these ten feed­s) be­­cause I have no re­li­able post­ing date, and must use in­­stead the date it was fetched.

Not nice.

Contents © 2000-2022 Roberto Alsina