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/ ) lists many RSS feeds.

Syntax Rules

%HEADLINES{"..."}%

Parameter Explanation DefaultSorted ascending
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
href="..." (Alternative to above) N/A
touch="..." Touch (edit/save) topics if the feed has updates. Specify a comma-space delimited list of TopicNames or Web.TopicNames, such as "%TOPIC%, NewsLetter". Useful to send out newsletter using MailerContrib, showing new feeds since last newsletter. To update feeds, visit topics with feeds in regular intervals (using cron with wget or the like). N/A
"..." 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]]:* $description" 
  format="$t* [[$link][$title]]"
  limit="4"
}%
to get the latest Slashdot news as a bullet list format:

Business Opportunities Weblog

Write

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

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

Mon, 26 Jan 2015 19:50:41 +0000
The original blog about business opportunities and business ideas for small business entrepreneurs
Mon, 26 Jan 2015 16:44:36 +0000 Dane Carlson

We all get tunnel vision sometimes, and can’t see all of the money making opportunities just outside our field of view. There’s a great new thread on Reddit with literally thousands of money making business opportunities.

Some of the highlights:

  • I do transcription from home. Mostly reality TV interviews but there’s a lot of other random junk thrown in there. Pretty cool and laid back job for a college student. It comes out to $12-20 an hour. Do a google search if interested.

  • I contract out to inspect welds on construction sites. Make about as much in two days on the weekend as I do during the week at my actual job.

  • I’m a party princess. I dress up as Disney princesses (with minor alterations and such to avoid getting a cease and desist letter from Disney), and entertain kids at parties. You kind of have to be at least a little good with kids, and have activities planned, and know your character inside and out. But yeah, I’m basically a group of children’s new god for an hour or two, and I make $50-70 an hour. It’s pretty cool.

  • I buy cars that have repairable problems or at auction. Cars that are dirt cheap, basically. I fix them up, clean them up and get them purring like they just drove off the lot. Then I sell them for much more than I paid and invested in parts. I flip like two or three a month sometimes. I’ve made over $1,000 on more than one occasion. One time I made like $3,000, but I got a ridiculous deal on the original purchase.

  • Plowing driveways. I live in a town half full of rich yuppies. They all have these huge houses with long driveways, but no means to plow them. 10 bucks a drive and I feel like I’m ripping them off.

  • I build custom computers for a $50 flat fee after the price of the parts.

  • I buy rare books and sell them online (sometimes I just buy them on Ebay and immediately resell them on Ebay for more money). This used to be my money on the side, but I quit my job 3 months ago, and it has paid enough to keep me not homeless.

  • I work as an audio to text transcriber on the weekend. It’s self employed and I work from home. I don’t earn huge amounts and it’s pretty tedious not ever having a day off, but it can add up to 80 a week or so, which really helps.

  • You know those “Keep Calm and ______” posters that Reddit hates? Yeah I make/design and sell those. My last 2 vacations were funded by these. Etsy is fantastic.

  • Cleaning evicted homes. I did it for my landlord during high school and college. $10 an hour under the table. I now have a strong stomach, carpentry, plumbing, and flooring skills. It sucks when you find used condoms or shit on the walls, but hey- I score some neato stuff that people leave behind.

  • I do voice overs from home.

  • I write top ten lists for a site called listverse.com, they pay $100 a list and haven’t rejected a single list I’ve sent so far.

  • I buy old wine barrels and convert them into furniture and sell for cash. Doesn’t make huge amounts but every bit helps and as my wife says ‘at least it is a self funding hobby!’

  • I bead jewelry and sell it for $10-50+ a piece online. I make roughly $100-300 in extra cash a month.

  • I recently made my own website1 about home automation. Its been a passion of mine for some time and now that some bigger players are getting into the industry (apple, samsung, etc.) there seems to be a lot of new interest in it. So I made a review site for the various equipment available and added in some amazon affiliate links. I dont make very much money but enough to justify keeping it going.

  • I do home repairs and improvements. I am a serious tool hoarder so I usually have the right tools on hand for any job and odds are that I also have whatever hardware or materials laying around for smaller jobs. I just did a laminate floor and made a $300 profit on it for 2 days of work. Usually, my jobs take about an hour and I make about $40 a clip. I don’t turn down much of anything except if the job looks like it’s going to blow up in my face or if the person needing the work balks at my original quote.

  • I make posters and album covers for local bands and small festivals. It doesn’t pay much, in fact, almost nothing, but I love it. It’s something I am good at and which I enjoy, and I work with awesome people from my local music scene.

  • I buy vintage jewelry at rummages and estate sales, and sell it on eBay. The best find to date was a gold bracelet that sold for over $200 profit.

  • I fix computerz is my local area. $60 flat rate. Sometimes I end up spending a few hours on them,but mostly it’s 15 minutes, in and out.

  • I’m a part time DJ. I enjoy it so much I sometimes feel bad even charging for it.

  • I teach music lessons at $35 an hour $25 for 30 minutes. It’s good money and even though kids can be whiney it’s still good money.

  • I run a YouTube gaming channel. Took some time to get off the ground but now it pays for itself as well as my gaming hobby.

  • I write papers for college and high school kids. 10 bucks a page. I’m an English graduate so it’s easy for me. Guaranteed B or your money back!

  • I breed corn snakes and ball pythons. The clutches only come around once or twice a year, but when they do, each egg is worth between 50-200 dollars when they hatch. I’ve never had a clutch with less than 12 eggs.

  • I have a flock of chickens and I sell or barter eggs. Fresh, free-range, organic, brown (or blue) eggs are like $5/dozen at the farmer’s market or Whole Foods. Even selling mine at $3 leaves $50 or so in my pocket after costs.

  • My dad and I deliver hot tubs for a small pool company. We have a special trailer that makes it super easy. People buy these $6000+ hot tubs that weigh upwards of 1000 lbs. and then realize they can’t deliver it themselves. That’s when we come in and charge $200 for an easy one or $300 if it has to go on its side.

  • I sell spreadsheets to small businesses. My friends initially laughed at me when I started but over the past several years I’ve been able to save enough (80,000) so I’m now in the position to let my wife stay off work whilst she looks after our 6 month old baby.

  • I grow salt water coral/anemones and the occasional fish. The fish don’t usually make up most of the money I make. I am constantly selling “clean” excess water from my tank to others who fuck up and need to replace the water in theirs. After 6 months-6 years the return on coral and anemones is ridiculous. Plus live rock and everything else… I can make an easy $1500-$2500 a month on the side for doing nothing but paying my electric bill.

  • Astronomer here! When not doing my day job, I do money on the side by writing freelance articles for various science magazines, like Astronomy, Sky & Telescope, and now working for an assignment for Discover. This can be for various topics in astronomy, from a cosmic ray observatory in Argentina to neutron stars that merge with regular stars to how to find extrasolar planets with radio signals- basically, whatever I find interesting and know my teenage self would find interesting. (For anyone really interested, my latest is actually in the current ie February issue of Astronomy, on the South Pole Telescope.)

  • I buy large off-lease lots of used business laptops. They’re usually without hard disks plus sometimes other issues. I fix them and clean them up, post them on eBay for twice what I have into them. Started as a hobby and now I do it in my free time at home. Makes me an extra $100-$200 a week.

Mon, 26 Jan 2015 14:29:12 +0000 Dane Carlson

It’s painful enough when an employer rejects you. But some add insult to injury by stealing material you prepared to promote your candidacy.

How should you cope?

There’s no surefire cure, as Vincent A. Gaglione Jr. learned. While jobless in spring 2004, the Cleveland resident pursued a middle-management position at an Ohio insurer. The concern asked him to create a marketing strategy focused on its independent field agents. He spent about 50 hours drafting a 25-page plan, then presented his detailed proposal to 20 officials over two days.

“We shook hands,” Mr. Gaglione recalls. “There was a lot of backslapping and they said, ‘We’ll be in touch.'”

He didn’t get the job. Mr. Gaglione soon found out the insurer was test marketing a key piece of his plan, even using the name he had given it. He left angry messages for two executives there. “I didn’t appreciate you guys taking up my time and taking my work,” his voicemail said. They never called back.

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 Main.TWikiPreferences. For example, to customize the USERAGENTNAME setting, create a HEADLINESPLUGIN_USERAGENTNAME setting in Main.TWikiPreferences.

  • One line description, shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Show headline news in TWiki 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 TWiki'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: TWikiHeadlinesPlugin/2.21
      * Set USERAGENTNAME = TWikiHeadlinesPlugin/2.21

  • 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)
    • $TWiki::cfg{PROXY}{HOST} - proxy host, such as "proxy.example.com";
    • $TWiki::cfg{PROXY}{PORT} - proxy port, such as "8080";
    • $TWiki::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 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-2009, Peter Thoeny, TWIKI.NET; 2005-2007, Michael Daum http://wikiring.de
License: GPL (GNU General Public License)
Plugin Version: v2.3 - 29 Aug 2009
Change History:  
29 Aug 2009: added touch parameter -- Peter Thoeny
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.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 - 29 Aug 2009

Topic revision: r2 - 2009-08-29 - 14:55:14 - TWikiContributor
 
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