WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] CNN.COM RSS feed not working with WP RSS widget (9 posts)

  1. MarkRH
    Member
    Posted 5 years ago #

    For some odd reason, the CNN.COM Top Stories RSS Feed stopped working with my blog's RSS Feed widget. It just says: "CNN.com
    * An error has occurred; the feed is probably down. Try again later."

    However, I can manually browse to the URL and it shows fine. http://rss.cnn.com/rss/cnn_topstories.rss

    The NASCAR and Planetary Society RSS feeds still come in fine. Anyone else seeing this? My guess is CNN changed something on their end to maybe cause parsing errors. My blog is at http://blog.markheadrick.com

    I just added their Technology Feed and it produces the same error.

  2. MarkRH
    Member
    Posted 5 years ago #

    Well, it works on a locally hosted blog on my PC. So, there might be a network connectivity issue between my Webhost and CNN or CNN is blocking the IP address/range where my website is hosted. Hmmm...

    I can connect to my webhost server via SSH and am able to ping rss.cnn.com fine. So.. I dunno hmmm.

  3. MarkRH
    Member
    Posted 5 years ago #

    Using my own RSS parsing script, it will work fine locally; however, when running it at the webhost, I get the following error: "XML error: not well-formed (invalid token) at line 7"

    Both are running PHP 5.2.6. CNN is not blocking my webhost, but something has changed on the server and/or at CNN causing parsing problems. Since my own script is having problems as well, this doesn't appear to be a WordPress only issue, although, they are most likely using the same or similar XML parsing functions.

    Argh..

  4. MarkRH
    Member
    Posted 5 years ago #

    I found out the following line is the culprit (at least with my script):

    <copyright>© 2008 Cable News Network LP, LLLP.</copyright>

    If I replace the copyright symbol "©" with the word "Copyright" before sending it through the parser, then it works without error. So, it looks like I'll need to find where the code in WordPress is that handles the RSS widget and do the same. My PHP error log is full of that same XML error so I suspect this is what's generating it.

  5. MarkRH
    Member
    Posted 5 years ago #

    I got it working with the Top Stories RSS Feed. The Technology one still doesn't work. To get it to work with the Top Stories feed, I had to add a line in the /wp-includes/rss.php file:

    function _response_to_rss ($resp) {
       // begin my additions
       @$resp->results = str_replace("©","Copyright",$resp->results);
       // end my additions
       $rss = new MagpieRSS( $resp->results );
  6. MarkRH
    Member
    Posted 5 years ago #

    Thought I would follow-up in case anyone finds this in a search.. part of the problem I realized was that the RSS Widget caches the RSS output for 1 hour by default before checking again.. so any code changes are not readily apparent because it's just sending what's stored in the cache. So, in the same RSS.PHP file, look for the following:

    if ( !defined('MAGPIE_CACHE_ON') ) {
    		define('MAGPIE_CACHE_ON', 1);
    	}

    Change that 1 to a 0 so it doesn't use the cache and you see immediate results to your code changes. My Nascar feed also stopped working and had to further modify the code to this:

    function _response_to_rss ($resp) {
       // begin my additions
       $resp->results = str_replace("©","Copyright",$resp->results);  // to fix Nascar feed
       $resp->results = str_replace("©","Copyright",$resp->results); // to fix CNN feeds
    
       //echo $resp->results;
       // end my additions
    	$rss = new MagpieRSS( $resp->results );

    Hope it helps.
    Mark H.

  7. morerockin
    Member
    Posted 5 years ago #

    Mark, I am having the exact same problem. However, I don't know where to start to edit the code. Which page is that located under? index.php?

  8. MarkRH
    Member
    Posted 5 years ago #

    As mentioned in bold above, everything is in /wp-includes/rss.php

    The Magpie variable definitions are within the init() function.

  9. fmckinnon
    Member
    Posted 5 years ago #

    Anyone had any luck using iTunes affiliate RSS feeds:

    Try this one - all I get is errors - if there is anyone out there who can get this to work, please post:

    http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/topsongs/sf=143441/limit=10/genre=22/xml?partnerId=30&LS_PARAM=http%3A%2F%2Fclick.linksynergy.com%2Ffs-bin%2Fstat%3Fid%3DQJ*v0oJgqDc%26offerid%3D146261%26type%3D3%26subid%3D0%26tmpid%3D1826%26RD_PARM1%3D

    You can copy/paste that long URL and it works fine, you can click the link in a browser, and it loads in Google Reader or other RSS aggregreators.

    I've installed KB Advanced RSS, Magpie RSS plugin, etc ... regardless of what I do, I'm getting this error.

    I kinda doubt it's my webhost, because if I add my feedproxy.google.com feedburner RSS feed address into either KBB or RSS widget, it parses just fine.

Topic Closed

This topic has been closed to new replies.

About this Topic