Kolbu

Computers, Gadgets and Beyond!
Subscribe


CNN News plugin

April 03, 2008 By: webmaster Category: WordPress Plugins

CNN has a number of RSS feeds with current news available, on a number of topics.

This plugin works both as a widget, as inline content replacement and can be used in themes. It can be used as all three simultaneously, but there can be only one instance of the widget. Multiple feeds can be configured and used accordingly. Clicking on a news item will of course take you straight to the relevant article at CNN, as per CNN Terms of Use.

I know there are generic RSS feed widgets out there, but I figured with so many CNN feeds they warranted their own widget with easier configuration than your average generic RSS widget.

NOTE! Always upgrade to the latest version if you experience problems, most things are fixed already. :-)

The latest version is 2.6.

Download CNN News plugin


Known bugs: See the Google News plugin post. These two widgets are virtually identical, so bugs also tend to be the same in both.

Let me know if you find bugs, or if you want additional features or changes. Admin-selectable news item look, extra class/id for CSS etc.


Another Test Feed


35 Comments to “CNN News plugin”


  1. Thanks for the plug in. The only problems I had were server side. My servers firewall blocks ALL fopen requests unless added to white list. These are the addresses I had to whitelist to get it to work for anyone else who might have a problem.

    edition.cnn.com
    rss.cnn.com

    1
  2. Hey, any chance you could set up a similar or the same plugin for Google News? What’s cool about them is that you can do a search on Google News for whatever topic you want, and the search results page is ALSO an RSS feed… meaning someone could have a custom setup for their particular page’s topic(s).

    Barring that, have a suggestion on which generic RSS feed widget is best for WordPress use?

    Thanks!

    2
  3. Thanks couchmouse! I’ve added a small note in the readme about firewall settings.

    3
  4. Hi Paul!
    A similar one for Google News can certainly be written. These widgets are fairly easy to churn out once you get past the initial hurdles. I’ll see what I can do!

    As for generic feed widgets, I did install a couple and checked them out but I didn’t really like any of them. Try FeedList, FeedCache, FeedSnap or RSSImport. Don’t be too surprised if they’re not exacly what you’re looking for though.

    4
  5. And the one for Google News has now been written. See plugin-repository at wordpress.org.

    5
  6. hey couchmouse:

    I think I’m running into the same blocked requests. My question (’cause I’m barely web-literate) is: How do I find the white list option you mention?

    Thanks
    John

    6
  7. @ John
    1. Your host has to allow/enable php fopen so your website can connect to cnn.
    2. The firewall is on your hosts server and you have to ask support to allow/whitelist the IP address you want to connect to. ie. edition.cnn.com and rss.cnn.com

    7
  8. I loved your plugin. I installed it yesterday and everything looked great for for 4 hours or so. Later I pulled up my site and my posts were gone. I was getting the following error under the Google News widget:

    Fatal error: Call to undefined function debug() in /html/wp-includes/rss.php on line 504

    I deleted the feed and added a new one. My posts were back but now I’m getting this error under the widget:

    Google News unavailable

    This makes me think Google changed something on their end. I hope this isn’t specific to me.

    8
  9. This only happens occasionally and doing a refresh gets rid of it but I’m concerned that visitors to my blog will not know that. When it happens it plays havoc with my template. A new visitor may think it’s my design when in fact it’s the plugin. What happens is that I ocasionally get this error message, “Call to undefined function debug() in …. /wp-includes/rss.php on line 504″. I don’t mind if it’s related to the feed but would like to see a message result that states an error resulted and to refresh the browser to reset it. Other than that I love both this and the NASA Image of the Day plugins!!!

    9
  10. Hi Jeff!
    Not much I can do about the error in line 504 in rss.php, as that is a WordPress file. I’ll see if I can file a but report with the guys. And I suspect that a PHP error will have a few html-codes around it, which is probably why you’re getting a strange layout when that happens.

    Or do you get a template mess without the error as well?

    OK

    10
  11. Hi braddoc
    The debug() call appears to be a bug inside WordPress, I’ll see if I can track it down and report it. The RSS support inside WordPress is a complete mess, and I might end up rolling my own instead of relying on WordPress functionality there.

    OK

    11
  12. Hi,
    Inserting into index.php of my custom theme gives
    “Warning: Invalid argument supplied for foreach() in /hsphere/local/home/xzamen/my.xzamen.info/wordpress/wp-content/plugins/cnn-news/cnn_news.php on line 622
    No default feed available”
    However using it in single.php works fine. But I really need it in index.php. How can this be fixed?
    Thanks.

    12
  13. Oops, php code disappeared :) I am inserting do_action(‘cnn_news’)

    13
  14. Hi Andrey!
    That looks like a bug. I’ll send you an email with a bugfix for you to try out.

    OK

    14
  15. Dear Webmaster:

    I’m getting the same error Audrey is. Can I get the same fix?

    15
  16. It is a nice plugin, any chance on the next version having a digest post feature?

    16
  17. Hi Brad!
    Do you mean something that would post a snapshot of the current news to a posting once in a while?
    OK

    17
  18. Hi,
    I’m testing your CNN widget on a new blog I have just launched, but am not happy with the display of the 5 CNN news links. These links appear as one large block paragraph, without any indication where one link ends and the other begins. I’d like to insert a small image at the start of each news link to clearly define each link. But when I tried inserting the image code into the cnn_news.php file at the place I presumed to be correct, it prevented me from activating the plugin. Instead I got a “fatal error” message. Can you tell me exactly where and how to insert this image before each news link?
    Thanks – am looking forward to hopefully resolving this!

    18
  19. Hi Dillon!
    You can add separators without editing the plugin source. The plugin itself is wrapped in a LI-tag with the id=”cnn-news”. The link-set is wrapped in an UL-tag (no id) and the individual links are all LI-wrapped. (View the page source on a page showing the plugin). You can use this information in your CSS file to say have a big bullet-like graphics in front of each link. As for the “fatal error”, you have most likely made a syntax error in your PHP-code. Se your webserver error log for additional information on what you did wrong. Hope this helps!

    OK

    19
  20. Greetings,

    Having trouble with the plug in. Running it as a widget. Runs fine if I don’t mess with it, but once I try to edit it (i.e. show only business feeds) it displays “feed unavailable.”

    Am I missing steps in the process? Using WP 2.7

    Thanks.

    20
  21. Hi crandall!
    Hm, not quite sure what that could be. Note that Google does not have a full list of feeds, so business may or may not be available as a sub-choice in your language. However, if you use english on your site it certainly should be. Can you try some of the others to see if it’s a general problem or not?
    OK

    21
  22. I tried replacing edit.php with tools.php and it didn’t work. I am running WP 2.7.1

    22
  23. Hi Rolando!
    Can you try the latest version of the plugin, it should be compatible with the new WP file layout without you having to edit anything. Running it here under 2.7.1 and that seems to work fine.
    OK

    23
  24. Hello,

    I just checked my version of CNN plugin and I’m using version 2.4 which is the latest. Latest on your site is version 2.2. Should I try your version?

    Thanks!

    24
  25. Hi Rolando
    Naa, that’s just me being slow. There is very little difference between 2.2 and 2.4, mainly the 2.7 series compat fixes. And I’ve implemented those by hand. So what looks like the 2.2 on the outside is really a 2.2 modified with the 2.4 changes. Could you describe in more detail how you’re using the plugin and what it is that doesn’t work? Email to olav at the obvious domain will also work if you want to write long.
    OK

    25
  26. I am trying to implement this on a content page. I tried both plugins and neither seem to work. I am using WP 2.8.1 version. What could be the problem?

    26
  27. Hi Paul!
    Tricky to say with so little information. Can you email olav at the obvious domain name with a link to the page you’re trying to add the plugins on? And some information about what kind of error messages you get. Have you tried the widget form as well, not just adding the short codes to a page/post? Same problem there? The two most common problems are too restrictive php-configurations and your hosting provider not allowing outbound connections. The plugins obviously need to fetch information remotely, so they need to be allowed that.

    OK

    27
  28. Hi, I feel kind of silly asking this but is it possible to make the feed appear on a static page and not on the sidebar? I would really like to use it as content, not just a sidebar feed. I tried copying the code into the html on a page, after installing the widget into the sidebar. Am I doing something wrong? Is this an option-to have the feeds on a page as opposed to just the sidebar?

    28
  29. [WEBMASTER - PLEASE DELETE LAST POST - MY URL INCLUDED MY SITEMAP BY ACCIDENT]
    Wow. Great Plugin! I like the trick to rotate stories, by keeping the name and title for the feeds the same. It would be great if 2 feeds could be combined, or better yet, interwoven (but would that be a function of the RSS feeder?).

    29
  30. Thanks for the great plugin! I listet it on my site.

    30
  31. Donk know if this plugin is still working. last comments was last year

    31
  32. hello is there anyway that you can update this plugin to the new version of wordpress 3.0.1??

    Thank You For Your Time.
    bill

    32
  33. Hi Bill!

    I’ve just testet the plugin with 3.0.4 and 3.1RC2 and it works fine under both releases. I see there is a typo on the settings page where it tells you to use cnn_news instead of cnn-news when inserting a newsfeed in a post/widget. I’ll fix that and release it as a minor update soon.

    OK

    33
  34. Warning: not well-formed (invalid token) at line 7, column 11 in /home/jspen211/public_html/Welcome/wp-includes/rss.php on line 385

    Can you help me trouble shoot this error messege? I get it everytime I try to use the CNN widget.

    34
  35. Hm, not seen this one before. Line 7 of rss.php is in the middle of a comment and should pose no problems for WP or the widget. Which probably means that the file is corrupted. Try downloading it again, or upgrading to the latest WP.
    OK

    35


Leave a Reply

*
  • Hit me

  • Current Poll

    Which sub-note are you getting?
    View Results
  • Another Test Feed