« Build Your Website with a Plan | Main | How To Automate Requests For White Papers »
October 29, 2004
How to Syndicate RSS Content
Since most blogging programs create RSS feeds, you can take advantage of this by using their headlines to create content for your site. Naturally you would have to ask permission for this but most folks don't mind a little free advertising. Many sites offer their feeds to syndicate, but some folks who are jumping on the blog bandwagon don't know how to tell you how to syndicate their content. This article will show you how you can use their headlines or offer others yours.
I wrote a similar article two years ago called "How to Setup Coranto so Other Websites Can Display Your Headlines" and if you would like to review it you will see most of the instructions on how to work with "RSS File Advanced" which is Perl/CGI script you would need to install. If you read that you will get a working knowledge of how to use the script. You can read the article here:
http://homebusiness-websites.com/article_blog_coranto_setup.html
If you have read through that then to grab another sites' feed you have to edit line 65
Starting on line 65 you will see:
%services = (
'eWeek' => "webattack.com/webattack.xml\teWeek",
);
I made a minor mistake here and called this eWeek, and this isn't an eWeek newsfeed. That doesn't matter here. What matters is the 'eweek' in single quotation marks, will be the name of the javascript file. I created a blank file using Notepad and saved it as eWeek.js, and uploaded it to the directory where I keep my xml files. I set the permissions of this file to 777 because the RSS fetcher script will need to write the Javascript into this file.
Notice on the end of the file being called is : \teWeek"'
\t is Perl, that means to leave a space the width of a tab... which is followed by the name of the feed.
On line 44, this is where you tell the script where your files are stored:
# directory where data will be stored, chmod 777
$datdir = "/home/homebus/public_html/xml";
So if you have followed along here, you see we have set this up to pull in a newsfeed. I would save the script and upload it to your CGI bin with a unique name. For example... I called this file "eweek-rss.pl"
Set the permissions to be executable (755) then call it from your browser and watch what happens. It will take a minute or so to do the fetching. Once it is done, using a template of your website you can add a Javascript to call the headlines:
<SCRIPT LANGUAGE="JavaScript1.1" SRC='http://homebusiness-websites.com/xml/eWeek.js'></SCRIPT>
If you want more control over how this data is displayed in your html template, you can put it in a table. If you don't like the fonts being used by the script you can edit the table code in the Perl script.
You can follow this very same method to offer your blog headlines to others, or use it to pull in someone else's headlines. For each newsfeed you want to call, you will need to rename the CGI script and change the settings on line 65.
To display someone's headlines other then your own you will have to ask for the path to the XML file if you do not see an icon on their site that links to it.
If you would like to see the example (mistake and all) I created pulling in the newsfeed used in this example, visit:
http://homebusiness-websites.com/eWeek
Posted by Steve MacLellan at October 29, 2004 03:24 PM
Trackback Pings
TrackBack URL for this entry:
http://www.homebusiness-websites.com/mt/mt-tb.cgi/6
Comments
Post a comment
Thanks for signing in, . Now you can comment. (sign out)
(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)