|
How Do I Put RSS Feeds On My Web Page? |
|
|
Written by Terry Brazil
|
|
Thursday, 31 August 2006 |
|
RSS Feeds: How To Use RSS Feeds For Search Engine Spider Food RSS is short for Real Simple Syndication. RSS is one of the best and easiest ways to add content to your blog or web site. In fact all you have to is simply set it up and it takes care of itself. You can say that bloging and site building with RSS is a set it and forget it type of thing.
There are several ways however to put RSS feeds on your web site or blog. Each way you do it has it's advantages and disadvantages. For the purpose of simplicity we will cover the two main ways to add content to your web site via RSS feeds.
Adding RSS Feeds To Your Web Page Using Java Script
Adding RSS feeds to your web page or blog using Java Script is the simplest way to do this. Although it may be the easiest it is not by far the best way if you are looking to make spider food for the search engines.
When adding RSS feeds via Java Script the feeds content is retrieved from the RSS feeds host site. It is then displayed on your page for your visitors to see it. But that is the problem with using Java Scripts to display your RSS feeds. Only your visitor will see it. Search engine spiders will simply see nothing. This means that the search engine thinks nothing has changed but yet your visitor see's something completely different.
To add a RSS feed using Java Script you just need to add this simple piece of code to your web site. To make this simple for everybody we will use a site that will generate our Java Script that we will use to display the RSS feed that we choose on our web page.
To start off lets go to rss-to-javascript dot com. On the left hand side you will see a button labeled RSS/RDF Converter. Go ahead and click on that one. You should now see a new page titled Convert A Feed. Simply go ahead and fill in the fields on the page. You can always go back and mess with all the various settings and republish it on your web site to see how they effect your RSS feed. When you are done go ahead and hit preview and see if works. If it does go ahead and hit Generate Java Script. This will make the code we need to display the RSS feed on your web page.
You should now be on a new page. What we want from this page is the code that will be displayed in the little white box. Go ahead and click on Highlight All and it will highlight the code. Now right click and click copy. Now go ahead and look at the code for your web page. Find out where you would like the RSS feed to be displayed and right click there and hit paste. Now simply go ahead and upload your web page again. You should now see the RSS feed on your web site.
Adding RSS Feeds To Your Web Page Using RSS2HTML
RSS2HTML is a script that easily runs from your web host. It is a single php file that will show the RSS feed in html. This allows search engine spiders to gobble up your RSS feed content. This makes the spider think that your web page is updated every time that the RSS feed changes. In the long run this will help your page ranking as well as your search engine ranking. There are many people that have used just RSS feeds to achieve a position above the fold on all the major search engines.
The first thing we need to do is get your hands on RSS2HTML. To do this simply go to RSS2HTML dot com and you will be given a few options. RSS2HTML also offers a service that will show your RSS feed information on a xml page hosted by them. We don't really want to bother with this since it is not very flexible. Instead go with option 2 which is download free RSS2HTML script. Simply go ahead and save the .rar file to your computer and extract it with winrar.
You should now have three files (rss2html.php, rss2html-docs, and sample-template). The first one is the actual php file that we will be referencing on our web page. The second is the documentation for rss2html. Read this for a further description on rss2html and how to make your own templates. The third file is the template. This file controls how your feeds are shown on your page. There are more templates available for RSS2HTML that will allow you to put pictures, audio, or videos next to your RSS feed information.
There are two ways to use RSS2HTML. To use RSS2HTML in it's simplest form we will simply add a link on our page that will load up the code as a stand alone page. First you will have to upload rss2html.php and the sample-template.html file onto your sites root directory. This should be the same place your homepages index file is.
Once this is done go ahead and make a link using relevant keywords that directs to the following page after you alter it.
http://<your-domain>/rss2html.php?XMLFILE=<your-rss-feed>&TEMPLATE=<your-template>&MAXITEMS=<max-items>
We will now have to go ahead and edit a few parts of this link. First off make the part that says <your-domain> into your actual domain name including the www. and the .com. Second edit the part that says <your-rss-feed> and make it the url to the RSS feed you want to publish. Last go ahead and change <your-template> to sample-template.html or whatever template you want to use. If you want you can also change the max-items to the number of RSS feed entries you want to display. When editing make sure you replace the whole section including the < and >.
Now go ahead and make that link we where talking about and make it point to the url we just made. Go ahead and upload your page again and it should now have a link that directs you to a new page that contains your RSS feeds entries. Now when you click on the link we made it will bring up a page that contains said RSS feed as its contents. This page is able to get spidered by the search engines but you would probably want something that you can imbed into an existing page.
Now lets talk about using rss2html so that it will make just a php file that can be included on any of your web pages. Like the last method we want to upload both of the files we did before. But before you do we have to edit the .php file.
The first thing we want to do is rename rss2html.php to a more suitable name. In this example we will say that we are putting this on a billiards site. So I would rename it to something like billiardsrss.php or something else easy to remember. Now go and open the file in notepad or word pad. You should now see a bunch of code that probably means nothing to you. No problem there are only a few places you need to find.
Now with the file opened go ahead and look for a spot near the beginning that says this $XMLfilename = "sample.xml"; . Go ahead and change the sample.xml to the url of your RSS feed. Next go and find the section that looks like this $TEMPLATEfilename = "BasicWebpage.htm"; or $TEMPLATEfilename = ""; . In these quotes we want to put our template file. So change BasicWebpage.htm to our sample-template.html that was included in the download. Finally we can edit the maximum entries we want shown by finding $FeedMaxItems = 10000; and changing the 10000 to whatever amount you want to show. The first two changes will be right at the top of the file and the last is about one quarter the way down.
Note: Some RSS feed url's will use special characters. This may throw off rss2html so you will need to use some special characters in their place. Please refer to the rss2html documentation if you need more help with this.
Now next we will want to add include the php file on your web page. To do this your web page must end in .php. You should be able to change your .html or .htm page to a .php with absolutely no problems. Now go and find the spot you want your feed to show. All we will have to do here is put the following code where we want the RSS feed to show.
<?php include('http://www.yourdomain.com/yourphpfile.php'); ?>
This piece of code is no different than the rest that we have used so far. First off change the your domain to your domains actual name. Then go and change yourphpfile.php to what you have named your php file to. Now go ahead and upload your file once you have pasted in your personalized code in it.
Now when you go to the page we just uploaded you should see your RSS feed information in the section you posted your php include in. You may want to go and put your php include code in a cell to make it look a little cleaner and separate it make it stand out from the rest of the page.
Now that you are armed with all the information you should need to start publishing RSS feeds on your web page. So go out there and start filling your web page with RSS feeds that will keep them search engine spiders feeding everyday.
Warning: include(http://www.guruofinfo.com/products/blogandrss/blogandrss.php) [function.include]: failed to open stream: HTTP request failed! HTTP/1.1 404 NOT FOUND
in /home5/stupidim/public_html/guruofinfo/mambots/content/kl_php.php(65) : eval()'d code on line 1
Warning: include() [function.include]: Failed opening 'http://www.guruofinfo.com/products/blogandrss/blogandrss.php' for inclusion (include_path='.:/usr/lib64/php:/usr/lib/php') in /home5/stupidim/public_html/guruofinfo/mambots/content/kl_php.php(65) : eval()'d code on line 1
|
|
Last Updated ( Wednesday, 06 September 2006 )
|