Simplefeed appears to be what I need. Sometimes, things work just like that: I add a feed, click "Refresh items", and bingo, there are all my feed items. This is the case, for example, for http://news.nationalgeographic.com/index.rss .

But when I do that for other feeds, such as http://www.medscape.com/cx/rssfeeds/Cardiology.xml, I get a message "You have to specify a valid date" . Umm...? Yes, I'd be glad to, but where?? And a valid date for what?? The feed shows up, but "Refresh this feed" generates this date message, and no items show up. Any suggestion? I don't think it's a bug, it's probably just me not knowing where to change something.

Ludo

Comments

m3avrck’s picture

This was just fixed yesterday. Please make sure you have the latest version.

modul’s picture

I re-installed Simplefeed with the version available through Drupal modules (5.x-1.x-dev), and I got the same result: "You have to specify a valid date"... The tar file was exactly the same as the one I had installed before. Are you sure the updated file made it to the Drupal site?

Ludo

divrom’s picture

I'm also having this problem with a version that I've just downloaded. I can also confirm that the tar file was the same as an earlier one I had installed.

m3avrck’s picture

What are the specific feed URLs causing this problem?

modul’s picture

In my case, the url (or one of the urls) causing the date problem is the same as the one I mentioned in my first post: http://www.medscape.com/cx/rssfeeds/Cardiology.xml

Ludo

silenceissexy’s picture

I think I tried about 10-15 different feeds and the ONLY one I could get to work was the National Geographic one mentioned above.

In simplefeed_item.module at line 397 there was a trailing 0 in the dateformat like this:

$values['date'] = format_date(strtotime($item->get_date()), 'custom', 'Y-m-d H:i:s 0');

I removed the 0 and then everything seems to work alot better... :)

Otherwise I love Simplefeed so far, just what I need... keep up the good work!

silenceissexy’s picture

Sorry, I mean O (caharcter) not 0 (zero), I'm a bit tired. It has to do with the time offset anyhow....

silenceissexy’s picture

Oh well, me again... :) as figures the dates does not work if you remove the O, it was just a lead to the problem.

Drupal checks to see if a date is valid like this:

    if (!empty($node->date) && strtotime($node->date) <= 0) {
      form_set_error('date', t('You have to specify a valid date.'));
    }

I think Simplefeed needs to be more tolerant against the feeds, if it can't find a valid date then insert current date instead.

Another feed (http://www.madonna.com/autogen_news_rss.xml) gave me error about missing URL. Sure, I want an url too, but if the author does not provide me with one there's not much I can do about it. So, I think Simplefeed should better ignore the missing url or perhaps insert the base url of the site in question.

ok, no more from me tonight... ;)

silenceissexy’s picture

I'm glad to say that all my dates issues seems to have been solved by upgrading PHP from v4.3.11 to v5.2.1. Looks like Simplepie needs atleast PHP v4.4.x to work properly as of the trunk?

Now I just wish all the feeds would have the same posted by id as the original post instead of being Anonymus... :)

m3avrck’s picture

Status: Active » Fixed

Ok the URL issue has been fixed. Also the anonymous user issue has been fixed as well.

The date checking should default to the current date since it only adds it one is set.

m3avrck’s picture

Also the date problem is for PHP4 and is committed so it works in PHP4 and PHP5 now.

Anonymous’s picture

Status: Fixed » Closed (fixed)