r2 - 2009-08-29 - 21:55:14 - 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/ ) lists 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
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
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

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:

Sun, 26 Apr 2015 14:22:00 +0000
The original blog about business opportunities and business ideas for small business entrepreneurs
Sun, 26 Apr 2015 14:22:00 +0000 Dane Carlson

One of the best ways that you can start seeking out new business opportunities is by envisioning where the future is heading. Now, you don't need to be a crackpot futurologist to figure out the latest trends, but you should, at the very least, be keeping a close eye on what new businesses and technologies are beginning to emerge.

Just ask yourself from time to time what's capturing the public consciousness? What is it that people are wondering about more and more, and how can I turn their interest into my financial advantage? By following this line of questioning, it's very possible that you'll be able to devise a new strategy for monetizing an emerging trend and create a lucrative and long-lasting business for yourself.

But, if you're feeling a bit at a loss for what trends are emerging, and how you might be able to turn a profit, then we're here to help. We've taken the time to identify some new businesses, industries and technologies that are growing day-by-day. By getting in at or near the ground floor of one of these emerging trends, you could very well be setting yourself up with something that can help you to achieve your own financial independence and wellbeing. So, take out a pen, put your thinking cap on, and get ready to dive headfirst into this list emerging trends.

Health Products: The popularity of Dr. Oz and other similar programs is due to increased public interest in health products, supplements and specialty foods. While the science is still out on many of these products, the fact remains that millions of consumers believe that these products have an appreciable effect on their health and wellbeing. While as an entrepreneur you may feel a bit like a snake oil salesman marketing these kinds of products, we're willing to bet that the profits you take in might make you feel otherwise. That being said, if you are considering pursuing an opportunity in this sector, then be sure to keep abreast of any regulatory changes that concern it. You wouldn't want to end up testifying before Congress, as Dr. Oz recently did.

Mobile Business Applications: We talk about it a lot, but the mobile app industry is an incredibly lucrative one, and a great business opportunity if you can get your foot in the door. As more consumers possess and use mobile technology, the need for businesses of all shapes and sizes to have a presence on this mobile technology grows. As an entrepreneur, you can find ways to assist those businesses with developing applications that can help them appeal to their technologically savvy user base. Even if you don't have programming experience, there are various reseller programs that can help you get into the mobile app game without knowing even a lick of code. Either way, it's a good avenue to pursue.

RELATED: AN INEXPENSIVE AND INTUITIVE WAY TO GET INTO MOBILE APPS

Green Anything: Whether or not you believe in climate change really doesn't mean anything. The fact is that the majority of people do, and the narrative surrounding recent natural catastrophes only reinforces this. While some entrepreneurs bemoan the costs of going green, other entrepreneurs, more rightly, view green products as an exciting opportunity. While many things have already ''gone green,'' one burgeoning green sector, which has been incentivized by tax breaks, is construction. If you already have experience working in the construction sector, then why not seize the business opportunity to offer green construction practices to clients? You'll be able to charge a premium for your services, and you might even be able to help the environment along the way - if that's the sort of thing you care about.

3D Printing: Each day brings a new story of how 3D printing is going to revolutionize the way we live. You may not believe it, but the more time goes on, the more based in fact those claims seem to be. There are many different ways that you can get involved with this exciting industry, not the least of which is being a 3D printer reseller. With so many manufacturers in the marketplace, many of them are trying to use reseller programs to gain an advantage over each other. Their battle with each other could be your business opportunity, especially if you have the sales acumen to make such a program work for you.

RELATED: 3D PRINTING: GET IN WHILE THE GETTING IS GOOD

There are, of course, many other trends emerging that can provide fertile soil in which to plant the seeds of your next business opportunity. So keep your eyes peeled and your ears open. Try to resist the urge to think of any emerging trend as just something people will tire of next month. Many people have done that before you, and most of those people have come to regret their decision. As an entrepreneur, you need to think broadly, so always approach any kind of business opportunity with an open mind turned toward the future.

Fri, 24 Apr 2015 20:24:00 +0000 Dane Carlson

Business opportunities come in a wide variety of shapes and sizes. One that you may have heard a lot about, especially nowadays, is affiliate marketing. Whether you're looking to expand your current business, or you're looking to get your start as an entrepreneur, affiliate marketing is something that you need to know about and understand.

So, what is affiliate marketing, exactly? We're going to be breaking it down to the basics so that you have a starting-off point for researching it more yourself.

What Are the Broad Strokes?

In essence, affiliate marketing provides an avenue for a business to expand its market reach. Rather than handling all of its marketing efforts itself, a business brings on other entities - anything from blogs to other businesses - to market its products or services to those entities readers or customers. It's an old marketing model, to be sure, but it's one that's become exceptionally popular.

How Does Affiliate Marketing Work for a Business?

If you're a business owner, then affiliate marketing may be something you want to look into. It will provide you with an opportunity to reach untapped markets.

RELATED: 12 WAYS TO MAKE MONEY ONLINE 

To do this, you will seek out other entities that operate within the markets that you're trying to reach. For example, say you're a company that manufactures exercise equipment. If you're looking to find affiliates to market your products, you may start with popular fitness blogs. These blogs, in exchange for monetary compensation, may agree to market your products toward their readers.

Now, you don't necessarily need to do all of that legwork yourself - the legwork being finding potential affiliates. There are, in fact, affiliate networks that you can work with, which will match your business with the right entities.

How Can I Become an Affiliate Marketer?

Just the same as affiliate marketing provides an opportunity for business, so too does it provide an opportunity for the enterprising entrepreneur. Rather than marketing your own business through affiliate marketing, you can become an affiliate marketer yourself.

Take the reverse of the example that we outlined above. Say that you're a fitness guru who runs a successful fitness blog. You can supplement the income that you're already earning through banner advertisements by entering into an affiliate relationship with a fitness-related business.

Just the same as businesses themselves, though, you can also seek out a relationship with an affiliate network. This network will relieve you of the duty of seeking out businesses to market and will instead push those businesses your direction. Of course, they will take a cut of the proceeds for providing you with this service.

Sounds Good, Right?

Affiliate marketing is everywhere you look these days. You've likely noticed how ads will follow you around the Internet as you move from page to page. That's affiliate marketing at work! So, don't just stand on the sidelines. Whether you're looking to expand your businesses reach or to earn extra income, affiliate marketing is something you should look into.

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

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions
 
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