Skip to topic | Skip to bottom

Perry-Thistle.net

P-TWiki > TWiki > HeadlinesPlugin

Family Web | Studios Web | Piano Web
TWiki
TWiki.HeadlinesPluginr1.4 - 02 Aug 2002 - 07:30 - PeterThoenytopic end

Start of topic | Skip to actions

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:

Mon, 01 Dec 2008 16:09:20 +0000
Opportunities, news, and links for small business entrepreneurs

Mon, 01 Dec 2008 16:09:20 +0000 Rich


Associated Press:

Several men wordlessly carry out furniture, broken computers and boxes of garbage from a large blue house on a quiet upstate street on a brisk autumn morning. Rusting bikes and an old grill lay discarded in the overgrown backyard which is spotted with empty beer cans and crushed milk cartons. The mood is oddly serene as the men unload the remnants of what was one someone’s home.

Todd Drake, manager of Empire Real Estate Management in Latham, is overseeing yet another eviction. The home’s former owner has long gone, leaving just debris and an old phone number in his stead. After a county sheriff’s deputy checks to make sure no one is inside, crews head in to change the locks and clean out the refuse - also known as a “trashout.” Drake is stoic as he watches his crew.

“We’ve been butt-kicking busy,” said Linda Hall of All REO Preservation. “I work in the field as much as I work in the office.”

So busy that Hall’s even working on putting together a nationwide plan to give work to other contractors, and currently has crews and subcontractors in several other states. Her business also offers its own training program for startups.

Photo by Associated Press.



Mon, 01 Dec 2008 15:08:57 +0000 Rich


Wallet Pop:

1. Phishing scams related to the financial crisis
According to the Federal Trade Commission, there is a new round of email scams out there that are tied to the financial crisis. Many of these emails “phish” for personal information — your Social Security number, account numbers, passwords, etc. The scammer then uses that info to steal your identity.

2. Scams related to the banking crisis
The banking crisis is presenting scammers with another golden opportunity. We’re hearing numerous complaints about official-looking emails that claim to be from a bank or from the FDIC (Federal Deposit Insurance Corporation). These emails prey on your fears, claiming your bank is in trouble or that money has been stolen from your account. Most ask for your personal information, which they then use to steal your identity or illegally access your account.

3. Home rescue scams
With today’s housing troubles, mortgage rescue scams are crawling out of the woodwork. These scams target people who fear losing their home and ruining their credit because of foreclosure. A “real estate investor” contacts you and offers to bring your payments current if you’ll sign over the deed. He offers to keep making the payments in the future. You’ll need to move out so he can rent the house, but you won’t have a foreclosure on your credit.

4. Mortgage renegotiation scams
A smooth-talking salesperson tells you he can renegotiate your mortgage with your lender and help you keep your house. He’ll require a fee (as much as $1,000 or more) before he can start, of course!

Problem is, the “deal” he gets is one that you could have gotten on your own, and it probably won’t be enough to keep you in your home. However, because he was “successful” in getting the loan renegotiated, he has technically earned his fee and there’s little that you can do about it.

5. Fake check scams
Everyone is looking for a little extra money these days. But if you get a check in the mail that you weren’t expecting, don’t get excited-and don’t cash it. It could be one of the many “fake check” scams going around.

These scams involve everything from claiming you won the Publisher’s Clearing House Sweepstakes to offering you work as a “mystery shopper.” But they all have one thing in common: you receive a check - a real-looking check, payable to YOU - for several thousand dollars. They tell you the money is to pay for contest fees, or is your fee for being a mystery shopper. They ask you to deposit the check and then wire them most of the money back.

Photo by ilco.



Mon, 01 Dec 2008 14:07:15 +0000 Rich


TechRepublic:

Whether you're an employee of a company or an independent professional working for yourself, you might have a chance to work from home. Be aware, though, that this arrangement can cause problems if you're not prepared. Here are some tips.

1: Dress the part

2: Keep a separate office

3: Discipline yourself regarding break times

4: Discipline yourself regarding snacking

5: Check insurance

6: Educate and set guidelines for the family

7: Establish start and stop times

8: Use a separate phone line for business

9: Clarify computer ownership and policies

10: Check zoning if necessary

11: Keep in touch with the boss

Photo by woodsy.


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<hr /><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 from the Plugin web (see below)
  • Unzip HeadlinesPlugin.zip 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
    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.10
Change History:  
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: http://TWiki.org/cgi-bin/view/Plugins/HeadlinesPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/HeadlinesPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/HeadlinesPluginAppraisal

-- TWiki:Main.PeterThoeny - 11 May 2005
-- TWiki:Main.MichaelDaum - 26 Apr 2006
to top

I Attachment sort Action Size Date Who Comment
style.css manage 1.3 K 21 Nov 2005 - 17:20 TWikiContributor?  

You are here: TWiki > HeadlinesPlugin

to top

Copyright © 1999-2008 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding P-TWiki? Send feedback

 


Edit IncludedSearch