RSS-Bridge / rss-bridge

The RSS feed for websites missing it
https://rss-bridge.org/bridge01/
The Unlicense
7.23k stars 1.03k forks source link

XPathBridge - how to parse dates in different formats? #4007

Open drelephant opened 6 months ago

drelephant commented 6 months ago

Describe the bug Date parsing for XPathBridge does not work in some cases.

To Reproduce I have a feed that has dates like:

<pubDate>Sun, 10 Mar 2024 00:00:00 +0000</pubDate>

I used ./pubDate in "Item Date Selector", but the dates don't show up in the feed.

Expected behavior Date parsing can use dates of this format (and others).

Desktop (please complete the following information): Installed via docker compose.

dvikan commented 6 months ago

@Niehztog

Niehztog commented 6 months ago

Hi @drelephant, It's difficult to pinpoint the cause of this issue without knowing your exact use case. It could be a number of things:

The extracted date is parsed using the PHP function strtotime. I have tested calling strtotime with the date string you provided and it seems to work fine. So I assume there is a problem with your XPath expression extracting the date. If you want me to help you further, please provide all the parameters you are passing to the XPathBridge or your full feed URL (you can of course omit the hostname of your private rss-bridge instance). I should then be able to help you.

mightymt commented 5 months ago

@drelephant This might be the same issue I have encountered with the XPathBridge.

You could try changing the item date selector to ./pubdate (i.e. all lower case) and see if it works then.