 |
Further
Reading ...
|
|
The New Internet - FREE VS FEE In the last three months of 2000, it is estimated that over 750 dot.com businesses went out of business forever. It was to be expected and very predictable because far too many dot.com enterprises were riding high on investor cash infusions, were...
Interview with RoundBerry.com President This week we talk to RoundBerry.com President, Rachel Daghir, and discuss web hosting and the convergence of Reseller web hosting. Hello, Rachel, tell us about RoundBerry.com and what exciting you have planned? We have a lot planned for this...
Resources for Starting an Online Business Anyone trying to start an Online business needs to have a number of resources before it is possible to build and promote a successful website. The following are essential tools that I have found very valuable.
1) Wordtracker
Before you...
Here’s a Sobering Thought While you are looking at your computer, it may be looking back at you. There is easy-to-get, even free, software that lets anybody spy on you, anytime you are on your computer. Most spyware is simple. It digitally stores copies of everything that is...
|
|
|
How to create a reliable RSS Feed.
|
 |
Written By:
Ted Peterson
|
|
|
| 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 - continued below ...
|
|
|
continued ...
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= "<item>\n";
$r.="<title>$t</title>\n";
$r.="<description>$d</description>\n";
$r.="<link>$l</link>\n";
$r.="</item>\n";
return $r;
}
function create_rss()
{
$r ="<?xml version=\"1.0\"?>\n";
$r.="<rss version=\"0.91\">\n";
$r.=" <channel>\n";
$r.=" <title>Core Download - Latest 20 releases</title>\n";
$r.=" <link>http://www.coredownload.com/</link>\n";
$r.=" <description>The essential shareware and freeware downloads!</description>\n";
$r.=" <language>en-us</language>\n";
$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.=" </channel>\n";
$r.=" </rss>\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. About the Author
Ted Peterson writes for CoreDownload. Visit them to see this RSS
feed system implemented.
|
|
|
|
 |
|
|
| _Additional Resources ... |



|
Free Up Memory (RAM) in Windows The processing power stored in the CPU of a PC is extremely important when running games, movie players, compression products and graphics software. However, when analysing overall system performance, CPU speed comes second to having sufficient...
Take Spectacular Nighttime Photos With Your Digital Camera - Part I Night photographs express a special something that cannot be seen in normal daytime photography. Whether it is a photograph of a moon and starlit sky over a windy deserted beach, the excitement of a downtown cityscape when the lights go on, or just...
Buy a home through your home computer If you're thinking about buying or selling a home, a good place to start your search is on your home computer. A recent study by the California Association of Realtors (C.A.R.) finds that Internet homebuyers are twice as satisfied with the...
|
|
|
|
|
|
 |
|
|
|