r1 - 27 May 2006 - 07:56:43 - TWikiContributorYou are here: TWiki >  TWiki Web > 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 Explanation Default
"..." source of RSS feed; this can be an url (starting with http) or a web.topic location for internal feeds None; is required
href="..." (Alternative to above) N/A
refresh="60" Refresh rate in minutes for caching feed; "0" for no caching Global REFRESH setting
limit="12" Maximum number of items shown Global LIMIT 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
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

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

Write

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

Write

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

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

Thu, 29 Jul 2010 18:11:57 +0000
Opportunities, news, and links for small business entrepreneurs
Thu, 29 Jul 2010 18:11:57 +0000 Rich Whittle

Who needs sleep when there are start-ups to launch? Between endless e-mail conversations and talkative co-workers, getting actual work done during the day isn’t always an easy proposition.

The New York Times has an interesting article about a group of entrepreneurs, freelancers, and software developers who have come up with a nocturnal solution to that problem.

Calling themselves the New York Nightowls, this group of roughly 30 techies meets every Tuesday night from 10 p.m. until about 4 a.m. to to work on pet projects and side ventures that they normally don’t have the time to focus on during the traditional workday.

As one of the group’s co-founders explains, “It’s six hours of uninterrupted, productive time where you’re surrounded by other creative people doing awesome things.”

The concept of late-night work sessions seems to a perfect fit for New York, it is the city that never sleeps after all, but similar groups have also formed in nearly a dozen cities including San Francisco and Boston.

Photo by The New York Time.


Thu, 29 Jul 2010 18:00:46 +0000 Angela Shupe

The USA Solar Store is a chain of independently run shops that offer alternative energy products. With 24 stores in 11 states, from California to Vermont, it is their goal to help bring renewable energy to everyday people all over the US.

Inspired by Helen and Scott Nearing, Dave Bonta and his wife moved to Vermont in the 1990’s with the intention of living the simpler life. What started as a lifestyle choice eventually became a business, providing the products people need to live a sustainable lifestyle.

Dane recently asked Dave a couple questions about the stores and his unique opportunity.

What is a USA Solar Store?

It is a chain of retail energy stores. Our mission is to provide a local resource for education, products and services spanning conservation, efficiency, and many renewable energy options. We are an entrepreneurial team of “mom & pop” storeowners connected by a common purpose and functioning as a buying group. As such, we offer the resources of a multi-million dollar enterprise with the local flavor of your neighborhood corner store.

What products and services do you sell?

Solar thermal solutions – (Evacuated tube and flat plate collectors, controls & storage tanks)
Photovoltaic (PV electric) systems – All types of modules and balance of systems gear)
Biomass appliances for space conditioning.
LED and CFL lighting and daylight lighting systems.
High efficiency appliances that conserve energy and water.
Design & customer support services – Installation either direct from store or professionally referred.
Electric vehicles
Composting toilets

The list goes on we have lots of products, most factory direct.

The USA Solar Store isn’t a franchise, so how does one start their own? How much does it cost, and what do they get?

It is a business op, like a franchise but no ongoing royalty fees. This year license fee is $75k-done in 3 payments, drawn like a construction loan, stepped to deliverables.

Store owners get proven business model (9 years strong), inventory, training, ongoing support, easy entry into very lucrative renewable energy market potential and a fantastic collaborative brain trust of positive people.

How many stores?

We are at 25 fully opened, 4 moving to open this Summer, 8 more moving through the screening process. Our immediate goal is 50 by next Summer.


Thu, 29 Jul 2010 17:10:13 +0000 Rich Whittle

Ponder the difference between the comedian and the musician. Both create and perform works to entertain audiences, but they go about protecting that work in different ways. The notoriously litigious music industry often resorts to the legal system to protect itself from pirates and samplers. But comedians don’t. So why hasn’t the joke well gone dry?

That’s the question discussed in a forthcoming book from the University of Chicago Press called “Intellectual Property Norms in Stand-Up Comedy.” Written by two professors from the University of Virginia School of Law, the book offers a case study in the axiom that more intellectual property rights aren’t always better intellectual property rights, reports Ars Technica.

For comedians, ripping off a joke is a major sin, but such cases almost never end up in court. Federal court, where copyright cases are heard, is too expensive to be worth it. Besides, copyright law only protects the exact expression, not the idea, so rip-off artists who add some different details are free to do so.

This hasn’t led to a dearth of jokes. Instead, comedians use social norms rather than law to enforce their joke rights, and these social IP norms have actually been part of the process that shifted comedy away from one-liners and “rim shot” jokes to today’s long-form observational comedy.

Continue Reading: “Did You Hear The One About The Comedian And The Copyright Law?”

Photo by marines.mil.


Plugin 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.

  • 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 TWiki's internal getUrl() method, Default: yes
    • Set USELWPUSERAGENT = yes
  • Timeout fetching a feed using the LWP::UserAgent, Default: 20
    • Set USERAGENTTIMEOUT = 20

  • 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>

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)
      • headlineText: article text (div)

Plugin Installation Instructions

  • Download the ZIP file
  • Unzip it in your twiki installation directory. Content:
    File: Description:
    data/TWiki/HeadlinesPlugin.txt plugin topic
    pub/TWiki/HeadlinesPlugin/style.css default css
    lib/TWiki/HeadlinesPlugin.pm plugin perl module
    lib/TWiki/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 TWiki 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, TWiki:Main.MichaelDaum
Copyright ©: 2002-2006, Peter Thoeny; 2005-2006, Michael Daum
License: GPL (GNU General Public License)
Plugin Version: v2.11
Change History:  
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.8
TWiki:Plugins/Benchmark: GoodStyle 100%, FormattedSearch 99.5%, HeadlinesPlugin 94%
Plugin Home: TWiki:Plugins/HeadlinesPlugin
Feedback: TWiki:Plugins/HeadlinesPluginDev
Appraisal: TWiki:Plugins/HeadlinesPluginAppraisal

-- TWiki:Main.PeterThoeny - 11 May 2005
-- TWiki:Main.MichaelDaum - 23 Jul 2006

Topic attachments
I Attachment Action Size Date Who Comment
elsecss style.css manage 1.3 K 21 Nov 2005 - 17:20 TWikiContributor  
Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
 
Powered by TWiki
, create new tag

This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.HeadlinesPlugin