Headlines Plugin

Description

This plugin displays RSS feeds from news sites. Use it to build news portals that show headline news.

Note: Syndic8.com ( http://www.syndic8.com/ ) is a good site listing many RSS feeds.

Subject Images

subject image alternative
amd topicamd.gif  
anime topicanime.gif  
announce topicannouncements.gif topicannouncements.gif
announcements topicannouncements.gif topicannouncements.gif
aol topicaol.gif  
apache topicapache.gif topicapache.gif
apimac topicapimac.gif topicapimac.gif
apmedia topicapmedia.gif topicapmedia.gif
apple topicapple.gif topicapple.gif
bsd topicbsd.gif topicbsd.gif
biotech topicbiotech.gif  
biz topicbusiness.gif  
books topicbooks.gif topicbook.gif
bug topicbug.gif  
business topicbusiness.gif  
caldera topiccaldera.gif  
censorship topiccensorship.gif  
classic topicgamesclassic.gif  
cluster topichcluster.gif  
clusters topichcluster.gif  
components topicnews.gif topicnews.gif
communications topiccommunications.gif  
corel topiccorel.gif  
database topicsoftware.gif  
debian topicdebian.gif  
development topicmanagemente.gif  
displays topicmonitors.gif  
doj topicdoj.gif  
ed topiced.gif  
educationtraining topicmanagementp.gif  
entertainment topicentertainment.gif  
encryption topicencryption.gif  
ent topicentertainment.gif  
fps topicgamesfps.gif  
games topicgames.gif  
gimp topicgimp.gif  
gnome topicgnome.gif  
gnu topicgnu.gif  
google topicgoogle.gif  
gov topicdoj.gif  
government topicdoj.gif  
graphics topicgraphics3.gif  
graphicstools topicgraphics3.gif  
grid topichcluster.gif  
gridcomputing topichcluster.gif  
gui topicgui.gif  
humor topichumor.gif topicplan9.gif
hardhack topichardwarehacking.gif  
hardware topichardware.gif  
ibm topicibm.gif  
id id-nix.png  
ie topicie.gif  
imac topicapimac.gif topicapimac.gif
intel topicintel.gif  
itmgmt topicmanagement.gif  
internet topicinternet.gif  
java topicjava.gif topicjava.gif
laptops topicportables.gif  
legal topicnews.gif topicnews.gif
linux topiclinux.gif topiclinux.gif
linuxbiz topiclinuxbiz.gif  
lotr topiclotr.gif  
management topicmanagement.gif  
mandrake topicmandrake.gif  
matrix topicmatrix.gif  
media topicapmedia.gif topicapmedia.gif
mediaall topicmediaall.gif  
microsoft topicms.gif topicwindows.gif
money topicmoney.gif topicmoney.gif
monitors topicmonitors.gif  
movies topicmovies.gif topicmovies.gif
mozilla topicmozilla.gif  
music topicmusic.gif  
ms topicms.gif topicwindows.gif
netadmin topicmanagemente.gif  
netscape topicnetscape.gif  
networking topicnetworking.gif  
news topicnews.gif topicnews.gif
officesoftware topicsoftware.gif topicsoftware.gif
opensource topiclinux.gif  
os topicos.gif  
osx topicaposx.gif  
patents topicpatents.gif  
pcgames topicgamespcgames.gif  
perl topicperl.gif  
personalcomputing topicapimac.gif topicapimac.gif
peripherals topicprinters.gif topicprinters.gif
php topicphp.gif topicphp.gif
pilot topicpilot.gif  
politics topicpolitics.gif  
portables topicportables.gif  
portablegames topicgamesportable.gif  
productannouncements topicannouncements.gif topicannouncements.gif
printers topicprinters.gif topicprinters.gif
privacy topicprivacy.gif  
programming topicprogramming.gif  
ps2 topicps2.gif  
quake topicquake.gif  
quickies topicquickies.gif  
redhat topicredhat.gif  
robotics topicrobotics.gif  
rpg topicgamesrpg.gif  
science topicscience.gif  
security topicsecurity.gif topicsecurity.gif
servers topicserver.gif  
scifi topicscifi.gif  
software topicsoftware.gif topicsoftware.gif
starwars topicstarwars.gif  
storage topicstorage.gif  
space topicspace.gif  
spam topicspam.gif topicspam.gif
supercomputing topicsupercomputing.gif  
suse topicsuse.gif  
sun topicsun.gif  
tech topictech2.gif topictech2.gif
toys topictoys.gif  
tradeshows topicannouncements.gif  
trends topicnews.gif topicnews.gif
turbolinux topicturbolinux.gif  
tv topictv.gif  
unix topicunix.gif topicunix.gif
upgrades topicupgrades.gif  
usa topicus.gif  
utilities topicaputilities.gif  
webhosting topicwebservices.gif  
webservices topicwebservices.gif  
webdevelopment topicwebservices.gif  
windows topicms.gif topicwindows.gif
wireless topicwireless.gif  
worms topicworms.gif  
xbox topicxbox.gif  
ximian topicximian.gif  
xmas topicxmas.gif  
x topicx.gif  

Syntax Rules

The %HEADLINES{...}% variable gets expanded to the content pulled from an RSS feed.

%HEADLINES% Parameter Explanation
href URL of RSS feed
refresh Refresh rate in minutes for caching feed; "0" for no caching
limit Maximum number of items shown
header Header. Can include these variables: - $channeltitle, $title: title of channel (channel.title)
- $channellink, $link: link of channel (channel.link)
- $channeldescription, $description: description (channel.description)
- $channeldate, $date: publication date of the channel (channel.pubDate)
- $rights: copyrights of the channel (channel.copyright)
- $imagetitle: title text for site (image.title)
- $imagelink: link for site (image.link)
- $imageurl: URL of image (image.url)
- $imagedescription: description of image (image.description)
format Format of one item. Can include these variables:
- $title: news item title (item.title)
- $link: news item link (item.link)
- $description: news item description (item.description)
- $date: the publication date (item.pubDate, item.date)
- $category: the article category (item.category)

The header and format parameters might also use variables rendering the dc, image and content namespace information. Note, that only bits of interest have been implemented so far and those namespaces might not be implemented fully yet.

Rendering the dc namespace

The following variables are extracting the dc namespace info, that could be used in header and format. Nnote, that some of the variables are already used above. This is done by purpose to use different feeds with the same formating parameters. If there's a conflict the non-dc tags have higher precedence, i.e. a <title> content </title> is prefered over <dc:title> content </dc:title> .
  • $title: channel/article title (dc:title)
  • $creator: channel creator (dc:creator)
  • $subject: subject text; this will also add an image according to the subject hash list , see above (dc:subject)
  • $description: ... (dc:description)
  • $publisher: the channel/article publisher (dc:publisher)
  • $contributor: ... (dc:contributor)
  • $date: ... (dc:date)
  • $type: ... (dc:type)
  • $format: ... (dc:format)
  • $identifier: ... (dc:identifier)
  • $source: ... (dc:source)
  • $language: ... (dc:language)
  • $relation: ... (dc:relation)
  • $coverage: ... (dc: coverage)
  • $rights: ... (dc: rights)

Rendering the image namespace

An image:item is converted into an <img> tag using the following mappings:
  • src: image url (rdf:about attribute of the image.item tag)
  • alt: image title (title)
  • width: image width (image:width)
  • height: image height image:height)

Rendering the content namespace

The variable $content is refering to the <content:encoding> content </content:encoding> .

Examples

see http://nats-www.informatik.uni-hamburg.de/NewsFeeds

HeadlinesPlugin Global Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, for example, %HEADLINES_SHORTDESCRIPTION%

  • One line description, shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Build news portals that show headline news based on RSS news feeds from news sites.

  • Set DEBUG to 1 to get debug messages in data/debug.txt. Default: 0
    • Set DEBUG = 0

  • Refresh rate in minutes for cached feeds. Disable caching: 0, default: 30
    • Set REFRESH = 30

  • Maximum number of items shown. Default: 100
    • Set LIMIT = 100

  • Default header: (variables are explained in the syntax rules)
      * Set HEADER = <div class="headlinesChannel"><div class="headlinesLogo"><img src="$imageurl" alt="$imagetitle" border="0"/>%BR%<from><input type="button" style="color:blue" value="Refresh" onclick="window.location.href='%SCRIPTURL%/view/%WEB%/%TOPIC%?refresh=on';" /></form></div>$n<div class="headlinesTitle">$n<h1>[[$link][$title]]</a></h1>$n<div class="headlinesDate">%SERVERTIME{$yea-$mo-$day, $hour:$min:$sec}%</div>$n<div class="headlinesDescription">$description</div><div class="headlinesRight">$rights</div></div></div>
  • Default format of one item: (variables are explained in the syntax rules)
      * Set FORMAT = <div class="headlinesArticle"><div class="headlinesTitle"><div class="headlinesSubject">$subject</div>[[$link][$title]]<span class="headlinesDate">$date</span> <span class="headlinesCreator"> $creator</span>$n</div>$n<hr/><div class="headlinesTeaser"> $description</div></div>

Known issues

  • Topic load time depends on timeit takes to load the RSS feed. A future version might include some caching to improve performance.
  • This plugin uses the undocumented TWiki::Net::getUrl() function. The plugin might break in a future TWiki release.
  • URLs on virtual hosts cannot be read, for example, TWiki:Codev/TWikiSyndication does not work. This is a limitation of TWiki::Net::getUrl()

Plugin Info

Plugin Author: PeterThoeny
Plugin Version: 02 Aug 2002 (V1.001)
Change History:  
02 Aug 2002: Implemented caching of feeds, thanks to TWiki:Main/RobDuarte
11 Jun 2002: Initial version (V1.000)
11 Nov 2004: big rewrite TWiki:Main/MichaelDaum
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.004
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/HeadlinesPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/HeadlinesPluginDev

Related Topics: TWikiPreferences, Plugins

Navigation

%IFSKINSTATETHEN{searchbox="pos2"}%

%FISKINSTATE%
%MYSIDEBAR%

 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback