ArticleTrader.com
  

 Main Menu

  Home
  Member Login
  Forum
  Submit Article
  RSS Feeds
  Contact Us
  About

 Services

  Article Distribution
  Link Building

 Tools

  ArticleMS
  Directory Tracker
  Earn with your Site

 Categories

  Automotive
  Business
  Computers
  Entertainment
  Finance
  Food
  Health
  Home and Family
  Internet
  » Affiliate Programs
  » Blogging
  » Domains
  » Email
  » Forums
  » Online Business
  » PPC Advertising
  » RSS
  » Security
  » SEO
  » Site Promotion
  » Spam
  » Web Design
  » Web Hosting
  Legal
  Science
  Self Improvement
  Shopping
  Society
  Sports
  Technology
  Travel
  Writing

82 users online.



 
  » Category Sponsors
  Get Your Link Here - Limited Time Bargain at only $11/month!

Home » Internet » Rss » Displaying an RSS Feed on your website using PHP and MagpieRSS
0
Votes
Vote Now
Article Stats:
Total views: 1214
Word Count: 346
Character Count: 2141
Options:
Get Html Code
Get PDF
Print View

Displaying an RSS Feed on your website using PHP and MagpieRSS


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.

mikel.beck@elite-computing.net

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


Source: ArticleTrader.com

Comments

There are no comments for this article, you can be the first to post a comment.

You must be logged in to comment.
Login Now or
Register Free Account

 Top Authors

 1 alien82 (2508)
 2 juliet (1618)
 3 sverdlow (1539)
 4 limalan88 (1123)
 5 AnthonyF (1055)
 6 IC (935)
 7 cdmohatta (767)
 8 lets_j2top@ya.. (748)
 9 isolvum (723)
 10 jkhbraveheart (629)
 11 jarnold (623)
 12 prabakar (576)
 13 homebizbuilder (523)
 14 reedstickets (489)
 15 cj (484)
  » Member List

 Latest Forum

» need help in parse error
» New ADD URL Directory - PR2 Get In It!
» ArticleMS 2.0 beta 3
» CSS
» See this!!
» Article Backlink Checker Plugin?

 Sponsors

Advertise Here
Commercial Water Removal
Phone cards


  
  Affiliate Program 2Checkout.com, Inc. is an authorized retailer of ArticleTrader.com

0.30s