Zeronese, Inc.
Home
Help & Support
Contact Us
Webmaster ResourcesArticle Details
 

Displaying An RSS Feed On Your Website Using PHP And MagpieRSS

Date Added: July 05, 2004 11:59:38 PM
Author: Mikel Beck
Category: Online Communities & Networks: RSS

These days everybody wants to have fresh content on their web site. Search engines like to see dynamic web pages, where the content is updated on a regular basis. Static pages that have information that doesn't change are not only boring, but less likely to be visited by a search engine spider than a page that changes every time it is displayed.

By using RSS and the MagpieRSS toolkit, you can import data from another web site or news source and display that information on your own site.

First, download the MagpieRSS kit from http://magpierss.sourceforge.net.

Next, unpack the archive, into a directory off your root on your web site called ""rss"".

Then, create a directory off your root called ""cache"". CHMOD this directory to 777.

You'll need to know the URL for the feed that you want to display. You can find this by searching for ""RSS feed"" in Google, or by going to one of the many sites that allow you to search thrown various sources for feeds. Syndic8.com is one, for example.

To display data from a single source, you can use code similar to this:

require_once('rss/rss_fetch.inc');

$news_feed = '';

error_reporting(E_ERROR);

$rss = fetch_rss(""http://www.url-of-the-rss-feed.com"");

$items = array_slice($rss->items, 0);

foreach ($items as $item )

{

$news_feed .= '' . $item['title'] . '' . $item['summary'] . '';

}

echo $news_feed;

MagpieRSS not only decodes the data, but it will also cache the data so it will retrieve news articles only once per hour.

Utilizing RSS in this fashion will allow your web site to have fresh content displayed constantly, and will (hopefully!) keep the search engine spiders interested in your site. The more the spiders index your site, the more pages you will have listed in the search engines. And with more pages listed in the search engine indexes you have a much better chance of attracting people to your web site.

Copyright © 2005 by Mikel Beck.


About The Author


Mikel Beck is the owner of a number of web sites, the latest being The Happy Hour Pub. http://www.happyhourpub.com
 
RELATED ARTICLES & TUTORIALS
Keep Your Website Contents Fresh by Adding RSS Feeds

RSS is a method that has been used by many webmasters and publishers to publish information and news online. The readers then be able to read the information and the news with their RSS readers. But


Teacher RSS Feeds Can Help Stop Classroom Management Problems And Streamline Your Time

It may be a new year, but you are probably still dealing with the same old ""kid problems."" The bad attitudes, disrespect, peer conflict, lying, school failure or family problems didn't change when you flipped the page on the calendar. Don't let last year'


All You Need To Know About Rss

Imagine the next time you join a discussion about RSS. When you start sharing the fascinating RSS facts below, your friends will be absolutely amazed.


RSS The Future Of Internet Marketing ? Part 1of 4

Are you an business owner/marketer/publisher who has opted for Internet marketing strategies, having created your website and has been on the constant run to win more visitors to your site?


Selecting An RSS Reader Or News Aggregator

While many have resisted the urge to decipher the meaning behind the acronym RSS, the vast majority of technically knowledgeable online surfers have begun incorporating RSS into their daily routines. Why go through the hassle of understanding something ne


 
Ratings Average rating: (null votes)
Comments

No Comments Yet.


Leave your comment:
Name or Website:
Email:
Comment
Visual Confirmation Security Code

*Enter the code shown:  


The views and opinions of authors expressed on Zeronese Webmaster Article Directory web sites do not necessarily state or reflect those of the Zeronese.net .