Affordable Website Design - or Here to email Affordable Website Design

Syndicate Your Articles
Free Articles and Tutorials for Web Designers or

CGIScript free and professional cgi and php scripts GraphicsFactory

How To Syndicate Your Articles
Details on setting up a syndicated article feed by William Bontrager

You have great articles or images or other content that people would willingly put on their sites.

That is, if it was easy for them.

Well, it *is* easy! Your syndicating sites put two lines of JavaScript into their pages. That's all they have to do.

Once those two lines are on their pages, the content on the syndicating sites will update automatically -- every time you change the master file on your server.

For example, to carry these WillMaster Possibilities articles on your site, put this JavaScript code on your page in the spot where you want the article to appear:

<script language="JavaScript"

(It's okay for the code to be in three lines instead of two.)

Once you have that code on your page, your page will automatically update with the new feature article every Tuesday.

Try it. See for yourself how it works.

This article shows you the technical how-to for syndicating your own content. It also provides a bit of information about a commercial program for those who like to have it really, really easy.

In addition to articles, you could syndicate recipes, poems, source code, calendar events, anything on remote sites that wants frequent updating. You could even use it to serve banners and other advertisements.

This is what you do:

First --

Decide on a file name for your master file (it should have a .js file name extension). Also, decide where it will be on your server.

Once you know the name of your master file and where it will be located, then you also know its URL. It will be something like

When you know your master file's URL, you also know what the JavaScript code for your syndicating sites will be:

<script language="JavaScript" src="[MASTERFILE_URL]"> </script>

Just replace [MASTERFILE_URL] with your master file's URL. Now you have the JavaScript code to give to your syndicating sites.

Second --

Create your master file.

It's a bit easier said than done, but once learned it could become more boring than hard.

The thing to remember is that your content will be a part of a web page, not an entire page by itself. So you code your HTML tags with that in mind.

The less specific font styles you specify, the more design control you leave for your syndicating sites. Unless yours is an unusual circumstance, it can be good for syndicating site owner relationships to let them fit your content into their site design.

However you decide to code your content, put it into your master file.

Probably the easiest way is to create a web page with your content and then copy the relevant portion of the source code for pasting into your master file.

Once you have your content in your master file, you need to make it JavaScript compatible before you upload it. Do these in order:

~~ Insert this as the first line of your file:

~~ Precede each backslash ( \ ) with another backslash:


~~ Precede each apostrophe ( ' ) with a backslash:


~~ Except for the first and last lines, end each line with:


(The above code is --

apostrophe - close parenthesis - semi-colon

-- for those with small font sizes.)

~~ Except for the first and last lines, begin each line with:


(That last character is an apostrophe.)

Save your file and upload it. Once your master file is uploaded, every syndicating site is automatically updated.

Here are three things you can not include in your syndicated content:

1. JavaScript code that accesses other files. In other words, you can not include other "syndicating" code in your syndicated content. (You can use most all of the available JavaScript language, but not this.)

2. CSS when the style sheet is on your server. If you include Cascading Style Sheet code, the definitions must be embedded in your content.

3. Server Side Includes. SSI can only include files and launch programs that are on the same server as the web page; SSI on syndicating site's servers can't reach your server.

Here are two things you should not include in your syndicated content:

1. Flash, PHP, and other recent technology that requires the domain's server to run specific software. If you know that all your syndicating sites are on compatible servers, then go ahead and include the technology. But if you don't know, it is best not to include it.

2. JavaScript cookie code. It's not that you can't set cookies, but the cookie must be set in the name of the domain where the content is being viewed at. It would take a bit of tricky scripting to retrieve the cookie for use later on.

Here is a list of things you *can* include in your syndicated content:

1. Any standard HTML tags that would normally go into the BODY section of a web page. This includes

~ sounds,

~ images,

~ forms,

~ tables,

~ headers,

~ plain text, and


Note -- there is an important restriction: ALL URLs (including HREF=..., SRC=..., and ACTION=... URLs) must be complete http://... URLs. The reason is because your content will be on remote servers, and those servers will be unable to correctly resolve your relative URLs.

If you use forms or other links to CGI programs, make sure those programs allow input from domains other than your own.

2. JavaScript code, except JavaScript code that accesses other files. You can use most all of the available JavaScript language, including

~ popup windows,

~ Date and time presentations,

~ JavaScript generated hidden form field values,

~ browser detection code, and

~ your own custom functions,

3. Cascading Style Sheets, when your CSS definitions are embedded in your content. The definitions must not be on your server because the syndicating site's servers won't be able to access it.

4. Hit counters and other links to CGI programs on your or other people's servers. Just remember to use complete http://... URLs.

As you can see, there are very few restrictions. Just about anything goes so long as you remember that everything your content requires must be included in the content itself.

Okay, I promised a link to a commercial program for those who like to do things the easy way. (Including myself -- I wrote the program in the first place because I wanted an easy way to syndicate my articles.)

Master Syndicator makes it very easy indeed.

You can maintain multiple categories of remote content. (No limit on the number of categories has been found yet.)

To automatically update your syndicating sites, (i) select which category/categories you want to update, (ii) paste your content into the form, and (iii) click the button. The Master Syndicator program encodes your content for JavaScript compatibility and updates the correct master files -- no hand coding and inserting funny little characters, no manual uploading; it's all automatic.

If you want to paste in a plain text file, you can tell Master Syndicator to insert the appropriate HTML paragraph tags.

One click and it's all taken care of!

More information:

Happy syndicating!

Permission is granted to reprint this article in its entirety, provided no reprints are sent in conjunction with or related to any unsolicited bulk email, provided no changes are made to the article, and provided the author's name, signature lines, and copyright line are printed with the article; except you may change the article's title.

Copyright 1999-2000 William Bontrager
Programmer/Publisher, "WillMaster Possibilities" ezine

© July 2003 Affordable Website Design - All rights Reserved
Add to Favourites       link To AWD       Disclaimer       Privacy       Tell A Friend