Welcome, Registration, and other StartingPoints; Foswiki history & Wiki style; All the docs...
Edit | Attach | New | Raw | Delete | History | Print | Tools
You are here: System » HeadlinesPlugin

Headlines Plugin

Description

This plugin displays RSS and ATOM 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.

Syntax Rules

%HEADLINES{"..."}%

Parameter ExplanationSorted ascending Default
href="..." (Alternative to above) N/A
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)
Global FORMAT setting
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)
Global HEADER setting
limit="12" Maximum number of items shown Global LIMIT setting
refresh="60" Refresh rate in minutes for caching feed; "0" for no caching Global REFRESH setting
"..." source of RSS feed; this can be an url (starting with http) or a web.topic location for internal feeds None; is required

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

Slashdot News

Write

%HEADLINES{"http://slashdot.org/slashdot.rdf" header="---+!! [[$link][$title]]$n $description" format="$t* [[$link][$title]]"}%
to get the latest Slashdot news as a bullet list format:

Business Opportunities Weblog

Write

%HEADLINES{"http://www.business-opportunities.biz/feed" limit="3"}%

to get the latest postings on the "Business Opportunities" weblog:

Thu, 23 Oct 2014 16:14:10 +0000
The original blog about business opportunities and business ideas for small business entrepreneurs
Thu, 23 Oct 2014 16:03:00 +0000 Dane Carlson

The International Franchise Association’s Educational Foundation (IFAEF) is pleased to announce the launch of the Young Entrepreneurs In Franchising Global Competition, a contest targeting students and young entrepreneurs around the world. The contest will run from Oct. 22 through Dec. 1. It will be hosted on the newly launched NextGen In Franchising website, http://nextgenfranchising.org, and marketed to global youth organizations, business and entrepreneurship professors, and promoted in the media and all major social media platforms.

Participants will submit business and marketing concepts for new franchise businesses or existing franchise brands for the chance to win a trip to Las Vegas, NV to attend IFA’s Annual Convention, Feb. 15 - 18 at MGM Grand Hotel. Contest winners will have opportunities to engage directly with leading franchisor, franchisee and supplier members of IFA and with other young entrepreneurs and students. The convention will also feature a NextGen in Franchising Summit, a two-day educational and networking program for next generation entrepreneurs and students.

“I am so excited about NextGen In Franchising because these young people are the future of our industry and we need to reach out to them to get them involved now, in a meaningful way,” said Melanie Bergeron, chair of the board, Two Men & A Truck, and incoming IFA chairman.

With the average age of the world population being under 30, and with one billion young people entering the workforce, the IFAEF is launching a bold new initiative to introduce young entrepreneurs and students to the world of franchising. Through a comprehensive marketing and educational campaign called NextGen In Franchising, millions will be exposed to the franchise business model as they’ve never seen it before.

NextGen In Franchising will encourage young people to explore opportunities to WORK, BUY or BUILD; essentially, pursue employment in the franchising industry, consider ownership of a franchise business or use the franchise model to start a business or expand an existing one.

“There is a huge talent pool of young entrepreneurs out there that we need to tap into to bring new ideas for new businesses and new thinking into our industry,” said Aziz Hashim, CEO, NRD Holdings and incoming IFA vice chairman.

With global youth employment and entrepreneurship education being touted as one of the most critical challenges to solve on the world stage, IFAEF is stepping forward to present this $840 billion industry, overflowing with entrepreneurial opportunities and jobs at all levels, as a powerful network that can make a serious impact. The new initiative is being funded as part of the IFAEF’s $10 million fundraising campaign called, Shaping the Future of Franchising.

The NextGen program has attracted more than $1.5 million in donations from major corporations, foundations and individuals. Major donors include: The Stewart & Jane Bainum Fund; Stephen P. Joyce Fund; Choice Hotels Foundation; J. Willard and Alice S. Marriott Foundation; Tariq Farid, Edible Arrangements; Charlie Chase, FirstService Brands, Inc.; Aziz Hashim, NRD Holdings; Amit Kleinberger, Menchie’s Frozen Yogurt; Joe Bourdow, Valpak; Melanie Bergeron, Two Men & A Truck; Amit Pamecha, FranConnect; and Lawrence “Doc” Cohen, DOC & Associates.

To anchor the campaign, the new dedicated NextGen in Franchising website, http://nextgenfranchising.org, will tell the story of franchising in a fresh new way to attract the attention of young entrepreneurs and invite participation in the Young Entrepreneurs In Franchising Contest.

For information on the NextGen In Franchising campaign, please contact Gionne Jones at gjones@franchise.org or call 202-662-0772. For more information on the Young Entrepreneurs In Franchising Global Competition, please contact Jen Malone at jenm@ysn.com or call 310-822-0261 x703.

Thu, 23 Oct 2014 14:10:45 +0000 Dane Carlson

Business Ideas in the News is a daily summary of the most interesting business ideas in the news.

Food

If a fast-food franchise can figure out how to get Americans to eat bugs, there are going to be a lot of new billionaires in Thailand.

Cheap supermarket whiskey is only typically aged for less than three years and uses colorings and flavors to give it a kick. Expensive whiskeys can be aged for 20 years or more, during which time it mellows and absorbs flavors from it’s wood storage cask. One Kickstarter proposes to speed up the entire process of making fine whiskey.

Tech

I’m waiting with bated breath for my $1500 propane bill, because unlike natural gas, which is plentiful and cheap, propane is still expensive. Maybe that’ll change now that scientists in the UK have created propane in a lab from bacteria.

As activists are pushing for higher minimum wages, McDonald’s is automating. Soon, we’ll order our Big Mac’s on touchscreens.

Lifestyle

I can never remember. Is facial hair in, or out? Either way, venture capitalists see opportunity in facial stubble.

In Brazil (which was originally settled by the Portugese and not the Spanish, like the rest of Latin America) the siesta isn’t a thing. One entrepreneur wants to change that and has opened a line of “Cochilo” nap centers.

And Finally

A Michigan funeral home, in addition to horse drawn carriages, now offers a drive-thru viewing option to the dearly departed. There’s an ending for everyone.

Thu, 23 Oct 2014 05:22:04 +0000 Dane Carlson

2 On this day in 1958, the Smurfs, a fictional race of blue dwarves, later popularized in a Hanna-Barbera animated cartoon series), appear for the first time in the story “The Flute with Six Holes.”

Plugin Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, for example, %HEADLINESPLUGIN_SHORTDESCRIPTION%. Note: Don't modify the settings here; copy and customize the settings in SitePreferences. For example, to customize the USERAGENTNAME setting, create a HEADLINESPLUGIN_USERAGENTNAME setting in Main.SitePreferences.

  • One line description, shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Show headline news in Foswiki pages based on RSS and ATOM news feeds from external sites

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

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

  • Use LWP::UserAgent, or fallback to Foswiki's internal getUrl() method. Default: yes
    • Set USELWPUSERAGENT = yes

  • Timeout fetching a feed using the LWP::UserAgent. Default: 20
    • Set USERAGENTTIMEOUT = 20

  • Name of user agent. Default: FoswikiHeadlinesPlugin/2.21.1
      * Set USERAGENTNAME = FoswikiHeadlinesPlugin/2.21.1

  • 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%</div><div class="headlinesTitle">$n---+!! <a href="$link">$title</a></div><div class="headlinesDate">$date</div><div class="headlinesDescription">$description</div><div class="headlinesRight">$rights</div></div>

  • Default format of one item: (variables are explained in the syntax rules)
      * Set FORMAT = <div class="headlinesArticle"><div class="headlinesTitle"><a href="$link">$title</a></div>$n<span class="headlinesDate">$date</span> <span class="headlinesCreator"> $creator</span> <span class="headlinesSubject"> $subject </span>$n<div class="headlinesText"> $description</div></div>

  • Values taken from configure: (only supported if CPAN:LWP is installed)
    • $Foswiki::cfg{PROXY}{HOST} - proxy host, such as "proxy.example.com";
    • $Foswiki::cfg{PROXY}{PORT} - proxy port, such as "8080";
    • $Foswiki::cfg{PROXY}{SkipProxyForDomains} - domains excluded from proxy, such as "intra.example.com, bugs.example.com";

Style sheets

The default HEADER and FORMAT settings use the following styles. See the style.css file defining the default CSS properties (indentation illustrates enclosure).

  • headlinesRss: output of the HeadlinesPlugin (div)
    • headlinesChannel: channel header (div)
      • headlinesLogo: channel logo (div)
      • headlinesTitle: channel title (div)
      • headlinesDate: channel date (div)
      • headlinesDescription: channel description (div)
      • headlinesRight: channel copyright (div)
    • headlinesArticle: one news item (div)
      • headlinesTitle: article title (div)
      • headlinesDate: article date (span)
      • headlinesCreator: author of article (span)
      • headlinesSubject: subect category of the article (span)
      • headlinesText: article text (div)

Plugin Installation Instructions

  • Download the ZIP file
  • Unzip it in your foswiki installation directory. Content:
    File: Description:
    data/System/HeadlinesPlugin.txt plugin topic
    pub/System/HeadlinesPlugin/style.css default css
    lib/Foswiki/HeadlinesPlugin.pm plugin perl module
    lib/Foswiki/HeadlinesPlugin/Core.pm plugin core
    Check if above examples show a news feed instead of variable.
  • Optionally, run HeadlinesPlugin_installer.pl to automatically check and install other Foswiki modules that this module depends on. You can also do this step manually.
  • Alternatively, manually make sure the dependencies listed in the table below are resolved.
    NameVersionDescription
    Digest::MD5>=2.33Required. Download from CPAN:Digest::MD5
    LWP::UserAgent>=5.803Optional. Download from CPAN:LWP::UserAgent

Plugin Info

Plugin Author: TWiki:Main.PeterThoeny, Foswiki:Main.MichaelDaum (2005-2007)
Copyright: © 2002-2009, Peter Thoeny, TWIKI.NET; 2005-2007, Michael Daum http://wikiring.de
License: GPL (GNU General Public License)
Plugin Version: 2.21.1 (08 Mar 2009)
Change History:  
08 Mar 2009: Ported without changes to Foswiki namespace by Kenneth Lavrsen and put under "Feel Free To Modify" in Foswiki context.
12 Feb 2009: {PROXY}{HOST} supports domain with and without protocol -- Peter Thoeny
06 Feb 2009: added {PROXY}{SkipProxyForDomains} configure setting, added USERAGENTNAME plugin setting -- Peter Thoeny
11 Dec 2008: added {PROXY}{HOST} and {PROXY}{PORT} configure settings -- Peter Thoeny
13 Sep 2007: fixed parsing of content:encoded
23 Jul 2006: improved atom parser; if a posting has no title default to 'Untitled'
26 Apr 2006: added lazy compilation
10 Feb 2006: packaged using the TWiki:Plugins/BuildContrib; minor fixes
03 Feb 2006: off-by-one: limit="n" returned n+1 articles; make FORMAT and HEADER format strings more robust
23 Jan 2006: released v2.00
05 Dec 2005: internal feed urls must be absolute
02 Dec 2005: added web.topic shorthand for internal feeds
29 Nov 2005: fixed CDATA handling
21 Nov 2005: added ATOM support; extended RSS support; added dublin core support; added content support; optionally using LWP to fetch feeds to follow redirections; corrected CPAN dependencies ; recoding special chars from html integer to entity encoding to increase browser compatibility; added css support; use getWorkArea() if available
11 May 2005: TWiki:Main.WillNorris: added DevelopBranch compatability
31 Oct 2004: Fixed taint issue by TWiki:Main.AdrianWeiler; small performance improvement
29 Oct 2004: Fixed issue of external caching if mod_perl or SpeedyCGI is used
02 Aug 2002: Implemented caching of feeds, thanks to TWiki:Main/RobDuarte
11 Jun 2002: Initial version (V1.000)
Perl Version: 5.008
Plugin Home: http://foswiki.org/Extensions/HeadlinesPlugin
Feedback: http://foswiki.org/Extensions/HeadlinesPluginDev
spacer
Copyright © 2014 Atomikos BVBA. Transaction Management for Extreme Transaction Processing and SOA Environments serving ISV, Commercial, OEM and Open Source Markets
Site map RSS ATOM