VictoryKey Internet Marketing Resource

Provide Dynamic Content to Your Website with RSS Feeds

Internet Marketing Strategies
Articles
Courses
Forums
Resources

Get notices of VictoryKey updates, possible JV partner opportunities, and more!

Fast & FREE Sign Up!

First Name:

Email Address:

I will never sell your personal information

by Michael Ellis (04/03/2006)

As a website owner your goal should be to continually provide updated content on a regular basis to your website in order to achieve or maintain a good search engine ranking. This obviously takes a lot of work – especially if you're the sole webmaster and content creator for your website. This article will you how to get fresh content updated on your site on a daily basis with very little work on your part using RSS feeds and PHP.

First, let me tell you what RSS is. RSS is short for Really Simple Syndication. It is a type of eXtensible Markup Language (XML) that is used for syndicating content. XML is basically a markup language that is used to describe data.

Before you read any further, let me say that the details outlined in this article apply to websites that can use PHP. For those of you not familiar with PHP, it is a popular server-side scripting language used to create dynamic content on your website. If your website is running on a UNIX variant operating system (like Linux), then chances are your web server supports PHP. You can check with your web host to be sure.

Now, I don't intent to make this article a long drawn out lecture on the technical details behind PHP, RSS and XML. That would just be too darn boring! Instead, I'll shoot to just layout the necessary details for a business minded individual to setup a website using these technologies in a quick and non-confusing fashion, hopefully.

Ok, here's your goal: Let us pretend that you have a gardening website and you want to add changing content to it on a regular basis using an RSS feed.

Naturally, since you're SEO minded, you want this new content to be readable by the search engine spiders. In order to accomplish that, you need to make sure the content is delivered via server-side scripting and not client-side scripting (like JavaScript). Using client-side scripting for pulling RSS content is a common mistake that many SEO conscious website owners make.

Ok, I'm going to slightly break my earlier promise and go into a little bit of technical detail here to help illustrate the point…

JavaScript is executed by the computer making the request to the web server. When a search engine spider comes across a webpage with a JavaScript 'script' tag, it stops doing its spidering tasks until it moves beyond the close 'script' tag. Essentially, all the text in between the script tags is ignored.

PHP, on the other hand, converts the script text to HTML on the web server itself, and then it sends the results back to the client computer in HTML form. So when a search engine spider finds a web page that uses RSS with PHP, the spider only 'sees' the HTML that is returned, just as if the PHP script were never there in the first place. Obviously the SEO conscious website owner will want to use PHP with RSS.

Given your task at hand, you now need the following 3 things:

1. RSS feed link

2. RSS script that converts an RSS feed into HTML

3. HTML output template

Acquiring an RSS feed link

You need an RSS feed link for your gardening website. A good place to start looking for this feed is 2rss.com. At 2rss.com you can run an RSS Search for the 'gardening' keyword. After you run the search, you will likely see a bunch of results. Click on any of them. You should notice an RSS2HTML link under the section titled 'Details' - this is your RSS feed link. Copy the full HTTP path for this link. You will be using this link for configuration in later steps.

You now need an RSS script that converts your RSS feed link into HTML, and then you will also need an HTML output-template that describes how you want the output to look

You can use an awesome PHP script called rss2html.php that, as the name implies, converts RSS to HTML. This script can be found here:

http://www.feedforall.com/more-php.htm (Select Option 2 -> Download)

After downloading and unzipping the file, you should now have an rss2html.php file and a sample HTML output-template file called sample-template.html. You will eventually need to copy these files to your web server, but let's configure them first.

The PHP file is where most of the configuration changes will be made. You can open this file with a regular text editor (like Word Pad) and make the following 3 configuration changes:

Change #1:

Find this line of code: $XMLfilename = "sample.xml";

Change it to: $XMLfilename = "Your-RSS-Feed-Link";

The above line of code instructs the PHP script where to find your RSS XML feed. This is the content that you're trying to add to your website. The website that provides the RSS feed will update this feed as new content becomes available (hopefully).

Change #2:

Find this line of code: $TEMPLATEfilename = "sample-template.html";

Insert the name of your HTML output-template in place of sample-template.html.

You downloaded a sample-template.html file from the feedforall link that you can make modifications to. If you don't intend for your entire website to be one big RSS feed page, then you need to modify the sample-template. The original sample-template.html file encompasses the entire HTML code from the open 'html' tag to the close 'html' tag. If you're using this content for your pre-existing webpage, then you will likely only want to use the HTML code between the open 'table' tag and the close 'table' tag. This will allow you to insert a table into your webpage where each row of the table represents an article from your RSS XML feed source.

Change #3:

Find the line of code: $FeedMaxItems = 10000;

The number '10000' indicates the number of items that you want to receive from the RSS feed, which in terms of our table example, works out to be the number of rows in your HTML table from the previous step. You can leave alone or you can change it to any positive number. For example, if you change it to 7, then the PHP script will display the top 7 articles from your RSS feed source.

Once you're done with making these configuration settings, you can then upload the files to your scripts directory on your web server. You can then add the following line of code to your website's HTML file(s) where you would like the RSS feed content to appear:

< ? include ('path_to_scripts_directory/rss2html.php');? >

Note: if your webpage is an html or htm file (filename.html or filename.htm), you will need to change it to filename.php in order for the web server to know how to handle the PHP script.

So there's an easy way to add changing content to your website without any extra work on your part!

Author - Michael Ellis (Email: michael@victorykey.com)

Talk more about this topic in our VictoryKey Internet Marketing Forum

 

Google
 
   

Internet Marketing Strategies | Articles | Courses | Forums | Resources

VictoryKey™, Copyright © 2005-2007 All Rights Reserved