question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[modules] Parsing pubDate with CDATA

See original GitHub issue

This feed contains items with next format:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="http://a.espncdn.com/dev/styles/espnfc/asteroids/rss.css" ?>
<rss version="2.0">
    <channel>
        <title><![CDATA[ESPN FC News]]></title>
        <link>http://www.espnfc.com/feed</link>
        <description><![CDATA[ESPN FC News RSS Feed]]></description>
        <language>en-us</language>
        <copyright><![CDATA[Copyright © ESPN Internet Ventures]]></copyright>

        <image>
            <url>http://a.espncdn.com/combiner/i/?img=/wireless/alerts/smsSplash/fc/fcicon.png&amp;amp;w=110&amp;amp;h=110&amp;amp;scale=crop&amp;amp;site=espnfc</url>
            <width>110</width>
            <height>110</height>
        </image>


        <item>
            <guid>2965916</guid>
            <title><![CDATA[Spain vs. Italy highlights international break]]></title>
            <description>
                &lt;img style=&quot;float: left; margin-right: 10px;&quot; src=&quot;http://a.espncdn.com/combiner/i/?img=/photo/2016/0627/r96608_1296x729_16-9.jpg&amp;amp;w=100&amp;amp;h=80&amp;amp;scale=crop&amp;amp;site=espnfc&quot; /&gt;<![CDATA[Spain&apos;s rematch with Italy headlines October&apos;s slate of World Cup qualifiers. Meanwhile, Gareth Southgate takes his first game in charge as England manager and can France keep moving forward vs. Bulgaria? Miguel Delaney &amp;#187;]]>
            </description>
            <link>http://www.espnfc.com/world-cup-qualifying/61/blog/post/2965917/spain-italy-renew-rivalry-gareth-southgate-takes-charge-of-england</link>
            <pubDate><![CDATA[Oct 5, 2016 12:49 AM PDT]]></pubDate>
            <enclosure length="150"
                       url="http://a.espncdn.com/combiner/i/?img=/photo/2016/0627/r96608_1296x729_16-9.jpg&amp;amp;w=100&amp;amp;h=80&amp;amp;scale=crop&amp;amp;site=espnfc"
                       type="image/jpeg"/>
            <category>null</category>
        </item>

        <item>
            <guid>2966016</guid>
            <title><![CDATA[Trending: England and Man United's Wayne Rooney feeling scrutinised ]]></title>
            <description>
                &lt;img style=&quot;float: left; margin-right: 10px;&quot; src=&quot;http://a.espncdn.com/combiner/i/?img=/photo/2016/0615/r92815_1296x729_16-9.jpg&amp;amp;w=100&amp;amp;h=80&amp;amp;scale=crop&amp;amp;site=espnfc&quot; /&gt;<![CDATA[Here are the latest stories for Wednesday.
&lt;img align=&quot;left&quot; height=&quot;50&quot;]]>
            </description>
            <link>http://www.espnfc.com/team/england/448/blog/post/2966016/trending-england-and-manchester-uniteds-wayne-rooney-feeling-scrutinised</link>
            <pubDate><![CDATA[Oct 5, 2016 06:00 AM PDT]]></pubDate>
            <enclosure length="150"
                       url="http://a.espncdn.com/combiner/i/?img=/photo/2016/0615/r92815_1296x729_16-9.jpg&amp;amp;w=100&amp;amp;h=80&amp;amp;scale=crop&amp;amp;site=espnfc"
                       type="image/jpeg"/>

            <category>Blog Post</category>
            <category><![CDATA[England]]></category>
            <author>ESPN staff</author>
        </item>
    </channel>
</rss>

It looks like the pubDate not parsed, so SyndEntry.getPublishedDate() returns null.

Please can you fix it, I use latest version from maven central: 1.7.0.

ESPN Soccer Headlines.xml.zip

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mishakocommented, Oct 5, 2016

Привет! The problem is not in CDATA, it is in their custom date format. It’s almost RFC 822 but not really. There should be no AM in an RFC 822 time. Although we could support this format, it seems pretty arbitrary. I wonder why they chose to format it like this and what tools did they use to do it.

I would contact the owner of the feed and ask them to adhere to the standard. Same goes for #318. If you still think that Rome should support these formats, please tell why.

0reactions
mishakocommented, Oct 6, 2016

@Hronom I meant that you should contact them. But now you don’t really need to, since you can define custom date formats in rome.properties.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to access <content:encoded> with CDATA from RSS feed?
Therefore, you need to use the ->children() method to select the right namespace: echo $item->children('http://purl.org/rss/1.0/modules/content ...
Read more >
RSS Feed Reading CDATA Problem - MSDN - Microsoft
Hi,. Have you tried XmlTextReader and Linq to XML to parse the XML? while (reader.Read()). {. switch (reader.NodeType).
Read more >
f# - RSS Parser for Blog Feed - Code Review Stack Exchange
Rss.fs. And the parsing code. The Rss module contains all the record types and a single Parse method that returns a RssFeed record....
Read more >
How to parse images from CDATA in RSS feed - Drupal
hello can anybody pls help me with directions how to setup feeds to get image from description element of feed item ? regards....
Read more >
WordPress plugins and themes
parse_feed Parse the feed from the server oik-batch. ... xmlns:slash="http://purl.org/rss/1.0/modules/slash/" > - [oik] plugins.com ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found