Just took core Aggregator for a whirl, and had to discard it because it doesn't seem to be using a source feed's original date/time of posting.

This also seems to be the case with the Feeds module?

Could you confirm my understanding and let me know if there is a way to use the original date (I've had a play with admin/build/feeds/edit/feed/mapping but didn't see a way to resolve this.)

Comments

alex_b’s picture

Title: Dates - use source/original date vs import date » Expose import date as mapping source
Category: support » feature

it doesn't seem to be using a source feed's original date/time of posting.

Hm, Aggregator does normally use the original date/time of posting (e. g. pubdate in RSS).

What is *not* supported at the moment in Feeds (but would be *easy* to support), is import time. This is maybe what you are looking for. What needs to be done to get import time is

a) Add the import time to every feed item when creating it (common_syndication_parser.inc and FeedsSimplePieParser) b) declare import time in FeedsSyndicationParser::getMappingSources() and FeedsSimplePieParser::getMappingSources().

velosol’s picture

@kulfi - If what alex_b mentioned isn't what you're looking for, could you post a copy of the date format or give the source feed that isn't correctly using the source date?

You might also want to try simplepie parser in case there is an issue with the common_syndication_parser that is included.

kulfi’s picture

Thanks for the lightening quick responses! Just to clarify

- the import date/time is being used, not the original date/time (not just time); &
- the feed I encountered this issue with is a Google Groups RSS v2 feed, e.g. http://groups.google.com/group/jquery-en/feed/rss_v2_0_msgs.xml

(Warning: I'm not a PHP dev) I traced this down to feeds/libraries/common_syndication_parser.inc function _parser_common_syndication_parse_w3cdtf($date_str).

This function is returning false when encountering this format <pubDate>Sat, 14 Nov 2009 07:26:07 UT</pubDate>.

kulfi’s picture

Hiya. I was despairing there was no fix for this, but I just got lucky trialling Sweetcron (http://code.google.com/p/sweetcron) which seems to parse Google Groups dates correctly!

Unfortunately, I maxed out my abilities by just tracing down to where the magic is happening (sweetcron\system\application\libraries\simplepie.php(10864)):

<?php 

/**
 * Date Parser
 *
 * @package SimplePie
 */

class SimplePie_Parse_Date
{
...
}

?>
velosol’s picture

@kulfi: A quick fix for you is should be to download SimplePie from simplepie.org and then copy simplepie.inc into feeds/libraries/ and swap your configuration to use the SimplePie parser instead of the Common Syndication Parser in the Feeds UI.

As far as the differences between the W3C date parser in CSP and in SP - they both are based around regexp's of the date string, but simplepie's works and CSP's doesn't for the PubDate that's been mentioned in this thread. I haven't dug into the differences - but perhaps SimplePie's can be used to enhance CSP's (licensing-appropriate of course)?

EDIT: I should also mention that there are 4 different functions that parse different date formats in SimplePie, and the W3C one doesn't appear to be the one that is parsing the previously mentioned PubDate - perhaps RFC2822?.

kulfi’s picture

Component: User interface » Code
Category: feature » bug

Changing this to Code/Bug Report. Looks like Feeds isn't playing very nicely with the dates used by Google Groups RSS and ATOM feeds.

kulfi’s picture

Title: Expose import date as mapping source » import date compatibility issues with Google Groups' feeds
twistor’s picture

Version: 6.x-1.0-alpha7 » 6.x-1.x-dev
Category: bug » feature
Status: Active » Patch (to be ported)

Committed the fix to 7.x.

I'm marking this as a feature request because Google Groups uses a non-standard (well, deprecated) time format.

twistor’s picture

Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.