digestdot.com digestdot.com
Search:    Site Home -> About Us -> Security & Privacy -> ToS -> Add Url -> Submit Article   
Add Url
 

Property & Estate

Education & Learning

Automotive

Online & Indoor Games

Culture & Art

Jobs & Careers

Finance & Banking

Society & Communities

Eating & Drinking

Home Family & Garden

Online Shopping

Relationship & Lifestyle

Sports

Teens & Kids

Science & Research

Issues & News

Travel & Accommodation

Self Management

Entertainment

Law & Politics

Medical Care

Health & Hygiene

Internet & Computers

Business & Services

 

  Site Home » Issues & News » RSS News Syndication
   
 

How to Create a Reliable RSS Feed

   

You probably already know what RSS is - it is a file format for syndicating news and the content of sites, in a very flexible manner. What you probably don't know is that creating a correct RSS feed is in many cases a very difficult task for webmasters. I am not talking about sites that supply just a few news a day, I am talking about sites that supply tens of news a day.

Let's take for example a shareware site. For the site to become popular, it has to be always up to date and to contain all the latest releases. So, the webmasters have to search for the new titles and add them to their databases. Many of them offer their visitors the possibility to stay informed about the latest releases using RSS feeds, which contain their names, links and short descriptions of the new releases. Visitors interested in this kind of information subscribe to the RSS feeds, using web-based or desktop aggregators, like Bloglines or SharpReader. All the aggregators query the RSS feeds every couple of hours, which is sufficient for many of the feeds, but not for all of them. It is a common practice that the feeds supply only the last 20 items, but what if, between two queries from the aggregators, appear, let's say, 43 items? Then, 23 of them wouldn't appear to the subscribers. Probably you've never thought about this, but I can assure you this situation really occurs, and you have to solve it, for you and your visitors' interest.

I will now show you a solution to this problem, implemented in PHP, one of the most used scripting languages on websites that are led by large databases. The main idea is that we will compare the date of the first and the 20th item, and if they are equal, we will run an extra query, to also add the other items that appeared in the database in the same day.

Lets suppose that the table from which we want to take the last items is named "products" and has 4 fields: "p_name" (product name), "p_added" (date when the product was added), "p_link" (product link) and "p_description" (product description). We have 2 functions, one that adds an item to the feed, and one that adds the standard elements of a RSS file, and then queries the database for the items added to the table on the current day.

function additem($t, $l, $d)

{

$r= "n";

$r.="n";

$r.="$dn";

$r.="$ln";

$r.="n";

return $r;

} function create_rss()

{

$r ="n";

$r.="n";

$r.=" n";

$r.=" n";

$r.=" http://www.coredownload.com/n";

$r.=" The essential shareware and freeware downloads!n";

$r.=" en-usn";

$q1="SELECT * FROM `products` WHERE 1 ORDER by p_added DESC LIMIT 0,20";

$result1 = mysql_query($q1);

$i=0;

while ($row = mysql_fetch_array($result1))

{

$i++;

if ($i==1) { $data1=$row[p_added]; }

$r .=additem($row[p_name], $row[p_link], $row[p_description]);

$data2=$row[p_added];

}

if ($data1==$data2)

{

$q1="SELECT * FROM `products` WHERE `p_added`='$data2' LIMIT 20,1000";

$result1 = mysql_query($q1);

while ($row = mysql_fetch_array($result1))

{

$r .=additem($row[p_name], $row[p_link], $row[p_description]);

}

}

$r.=" n";

$r.=" n";

echo $r; }

As you will see if you use this solution on your website, your feed's subscribers will find out about all your items (products, articles, or anything else), no matter how many they are. You can see this solution implemented on CoreDownload.com, a brand new shareware and freeware directory, that offers its visitors 3 RSS feeds: one for all the products, one for shareware and one for freeware.

Author: Ted Peterson
 
Author Bio:

Ted Peterson

Ted Peterson is a freelance author that works for Adolix and Core Network.

This article can be searched using: rss feeds, rss news feeds, free rss news feeds, rss feeds news, news rss feeds, google news rss feeds
 
 
 

Related Articles

 
Philadelphia Church of God Leads Laodicean Era (Conclusion)
 
And Now the News
 
Besmirching Manipur Media
 
New York Personal Injury Laws
 
Purity
 
Hugo Chavez Bluff is Showing Weakness and Manhood Issues
 
Woman - Smaller Brain - Less Intelligent
 
Update Your Websites Content 'Automatically' 24/7 Using RSS(Real Simple Syndication) and RSS Feeds
 
Heaven: Which Way?
 
Jet Movements, Part 2
 
 
 
 
 

It's Time Once Again for..."From Time to Time"

From time to time I share with my readers some of the reasons (there are about 10,000 of them and gr ... - Douglas Bower and Cindi Bower
 

How To Write A Newsletter Without Being A Writer

One of the best ways to stay in touch with current and past clients, colleagues and fans, is to publ ... - Eileen Parzek
 

Google Does RSS

Has Google finally embraced RSS with their new XML powered Sitemaps program? Well, sort of, but it s ... - Titus Hoskins
 
 

Moussaui Deserved the Death Penalty; 9-11 Hurt Our Economy

The nineteenth hijacker flunky Moussaui deserved the death penalty for causing so many people to los ... - Lance Winslow
 

National Day of Regret

To hear liberals tell it, George W. Bush doesn't have a prayer of succeeding. What with the war in I ... - Nathan Tabor
 
 
Site Home -> Security & Privacy -> ToS
© 2006-2008 www.digestdot.com All Rights Reserved Worldwide.