[Gambas-user] New component gb.rss to generate and parse RSS documents
Benoît Minisini
gambas at ...1...
Tue Apr 18 21:37:14 CEST 2017
Le 18/04/2017 à 19:52, Benoît Minisini a écrit :
> Le 18/04/2017 à 19:44, Tobias Boege a écrit :
>> On Sun, 16 Apr 2017, Benoît Minisini wrote:
>>> Le 02/04/2017 à 18:07, Tobias Boege a écrit :
>>>>
>>>> * The date conversion routines ignore timezones completely, because
>>>> I have no clue about working with timezones in Gambas.
>>>>
>>>
>>> Hi, Tobias.
>>>
>>> I have added in revision #8122 two functions to the gb.util component:
>>>
>>> Date.ToRFC822(), to convert a Gambas date/time value to its RFC822
>>> string representation, with the timezone.
>>>
>>> Date.FromRFC822(), to do the contrary.
>>>
>>> Tell me if you can use them, and if you need me to add the same
>>> functions for RFC3339 date format used by Atom.
>>>
>>
>> Thanks for these. Reading the code (not testing it yet), I noticed four
>> things:
>>
>> * The weekday and second parts in the format are optional in the RFC
>> but mandatory in your parser.
>>
>> * The year is a 2-digit number in the RFC. The RSS spec says it prefers
>> 4 digits. My current parser in gb.web.feed supports both, but treats
>> 2-digit years XY as 19XY (which I think is the most sensible
>> interpretation with respect to the RFC but sadly excludes publication
>> dates for news items near Christ's birth).
>>
>> * There is no consistency check in the parser if, in case a weekday is
>> given, it matches the weekday of the date, like
>>
>> Fri, 18 Apr 2017 12:00:00 GMT
>>
>> would be invalid by the RFC ("5.2 SEMANTICS"), because the 18 Apr
>> 2017
>> is a Tuesday.
>>
>> * At one point you use Format$(..., "hh:nn:ss") which I think may be
>> dangerous, because Format$() (as per docs) replaces ":" by the
>> locale-
>> specific time separator. I don't know if there are locales where this
>> is different from ":", but the RFC requires it to be ":" exactly.
>>
>> My parser does these four things. If you want to add them, the
>> gb.web.feed
>> code is sufficiently commented in the relevant places.
>
> OK, I will look at it.
>
I have updated the gb.util components with your fixes. Now I think you
can use it directly in gb.web.feed.
Regards,
--
Benoît Minisini
More information about the User
mailing list