newsfeed

NP_NewsFeed

NewsFeed: Import RSS / XML News feeds in your weblog.

General Plugin info
Author: Xiffy (no longer nucleus, so no example here), admun (Edmond Hui)
Current Version: 0.95
Download: download as a zip file (older code v0.94)
Code: NewsfeedCode (v0.95)
Demo: -
Forum Thread: -

How to use the plugin

This document describes in short the posibilities you have with this plugin. Within your skin you can call

<%NewsFeed(http://slashdot.org/slashdot.rdf)%>

(Attention: The code is case-sensitive, so NewsFeed works, Newsfeed for example will not work) This will grab the latest headlines from slashdot and shows them on your site. Installation options: After you have installed the plugin you can modify some defaults this plugin uses. You will need to create a directory for caching youself (see below).

  • Time before cache gets refreshed (Cachetime): This plugin caches the data it finds and so eliminating calls to other hosts as much as possible. Time is in minutes.
  • Directory where to put the cached data (relative from MEDIADIR) (Cachedir): The cache is stored relative from your in Nucleus media dir (./media by default). By default this is called rsscache so when all is set to default you will get media/rsscache. All sites are cached with the following filename: hostname_dir_filename.ext so the example http://slashdot.org/slashdot.rdf will have a cache file slashdot.org_slashdot.rdf
  • Titlediv: Around each title there will be a div. Nothing you can do about it ;-), you can however give this div a classname you already have in your css file. Defaults to feedTitle.
  • Classname for the links when shown seperatly (Linkdiv): When links are shown seperately from the title (explain later) then another div is put around the link. Here you can give this link a name. Defaults to feedLink.
  • Classname for the description in de feed (Desctiptiondiv): When syndicated descriptions are shown alongside whit the title then a div is put around the descrption. Here you can give this class a name. Defaults to feedDesc.
  • Should we include the sites meta data as logo and title? Yes or No
  • If filled with anyname all links will include target=”anyname” Here you can add _blank or any other target window name. Don’t include the parenthesis: " too. The plugin will add them for you.

Tuning in the skin

In the skin you can tune the reader what it should show. There are 4 posibilities:

  1. With the option 1 (default) you’ll get the title’s displayed as links
  2. With the option 2 you’ll get the title as plain text and an [read on] as link to the article
  3. Option 3 is identical to option 1 but adds the syndicated item as well. So when the site publishes the first 100 words of the article, you’ll get it here too.
  4. This is almost the same as 3, only the link is again displayed as: [read on].

To call the headlines from a site you need to know the location for the rss / rdf page. In the example above I used the rdf for slashdot which contains the latest 10 headlines of their site. The exact location of the xml-rss file is what you put in the first position to import the headlines from any site.

Blogrolling

Found out that Blogrolling.com offers beside javascript and PHP also an RSS feed of you favourite weblogs. And that is a cool thing because now you don’t have to use javascript or php on your website to get a fresh blogroll everytime someone visits your page. (This is a lot of traffic and it’s an external site which can slow your page down). When you use the newsfeed plugin to do this work for you, you will cache the blogroll. This will give you a better control over the way the bloggroll looks since all items get their classes around them so just update your css file for complete control.

version history

  • History 0.92:
    • Added a third parameter; amount of headlines <%NewsFeed(http://slashdot.org/slashdot.rdf,1,7)%> Will show 7 headlines with the type 1 format (see above for details on how to change what is showing ....)
    • Added newsfeed meta data. Title and image will show.
    • Resolved problem of function redeclaration when used multiple times on the same page (to show more than 1 newsfeed).
  • History 0.93:
    • Added yet more plugin options. You can now ay yes/no to the title and image the source provides.
    • You now have te abillity to add a default taget window for links that open by clicking links in the newsfeed.
    • Resolved the counting problem where you always loose 1 item (stupid bug ;-)

if you have an earlier version of this plugin installed and want to use the new version you are strongly advised to uninstall the plugin and reinstall it after uploading the new version. Otherwise the new options won’t show, and behaviour will be unpredictable!

  • History 0.95:
    • added supportsFeature
    • fixed ask 4 get 3 bug (again :-) )
    • add option to control whether to display feed temp unava message

Plugin review

NP_Newsfeed version 0.95 works with Nucleus CMS 3.31 - 2007-12-18 kg

:: Plugins ::

 
newsfeed.txt · Last modified: 2008/06/15 01:19 by xiffy