Syndicate Any Web Pages
Any web page, article, quote or other web page content
you want to make available to web masters for publication
can be syndicated.
Here is a demonstration (using this article as an example):
Simply copy and paste the following JavaScript into a web
page.
<script
type="text/javascript"
language="JavaScript"
src="/library/syn.cgi?art276">
</script>
When you load the web page into your browser, this article
appears in place of the JavaScript.
Go ahead. Do it. See for yourself how easy it is.
Now, imagine making it that easy for other web masters to
publish content you make available to them.
If it's content they want to publish, and they know it's
available, they'll publish it because it's so easy to do.
Your instructions could be:
"To publish this article/quote/whatever, simply copy and
paste this JavaScript into your web page."
And then provide the JavaScript (like the demonstration
above).
How To Set It Up
First, grab a copy of the script to do the syndication.
It's free from /a/27h/pl.pl?276art
The instructions are in the script, but I'll help you
along a little bit here.
The script requires module LWP::Simple to be installed
on your server. Master Pre-Installation Tester from
/a/27h/pl.pl?mpits can be used to
test, if you're uncertain whether or not the module is
present.
Open the script with a plain text word processor like
NotePad or BBEdit. This is important. WYSIWYG and even
web page editors can insert script-breaking characters
into the file.
Go back to the demonstration JavaScript near the top of
this article. The JavaScript contains a URL. At the end
of the URL is a "?" character followed by a code.
That code tells the script where to find the content for
syndication.
About 35 lines down from the top, you'll see an
AUTHORIZEDPAGES section. Here is where you tell the
script where to find your content for syndication.
On a blank line in that section, type
code=URL
where code is the code that will be used in the JavaScript
and URL is the http://... URL where the script will find
the content to syndicate.
A special code is one ending with ".all" (no quotes).
Examples: "code.all" "my.code.all" "anything.all"
When a code ends with ".all", the entire web page is
syndicated, all of the source code head, body,
everything.
When a code does not end with ".all", only the web page
section between the BODY and /BODY tags is syndicated. (To
specify sections within the BODY area to syndicate, or to
exclude certain sections, see "Specifying Exact Content For
Syndication," below.
You can have many code=URL lines.
The script has examples.
Below the AUTHORIZEDPAGES section is a place where you can
provide the URL of a default web page, in case someone uses
a code in their JavaScript not on your code=URL list. (If
you want no content to be published in that circumstance,
remove the example URL that was in the script when you
downloaded it.)
It is recommended that a default web page URL be provided
in the script at least until initial testing is complete.
Upload the script with an FTP program as a plain text file,
give the script 755 permissions, and test it.
Testing Your Installation
In your browser, type the URL to the script you installed.
The script is not meant to be used this way, but do this
to verify the script runs without errors. If the script
runs okay, you'll see weird JavaScript statements. That's
good. If it doesn't run okay, you'll see an error message.
In that case, /support/faq/ might be
able to help.
When the script has been verified to run okay, put the
demonstration JavaScript on a web page. Replace the URL
with the URL to your script. And replace the code with
a code you specified in the script.
Load the web page with the JavaScript into your browser.
If the content for the code you specified displays in your
browser, you installation is successful.
Specifying Exact Content For Syndication
To specify which content in the BODY shall be syndicated,
use special BEGIN/END syndication comment tags:
<!--BEGIN_SYN-->
Content
for
syndication.
<!--END_SYN-->
If no BEGIN/END syndication comment tags are used, all of
the BODY content is syndicated unless special "exclude"
syndication comment tags are used.
Use these tags to exclude certain content from syndication:
<!--BEGIN_NO_SYN-->
Content
being
excluded.
<!--END_NO_SYN-->
If the need arises, both types of syndication comment tags
may be used on the same web page, and they may be used more
than once. Example:
<!--BEGIN_SYN-->
Content
for
syndication.
<!--END_SYN-->
<!--BEGIN_SYN-->
More
content
for
syndication.
<!--BEGIN_NO_SYN-->
Content
being
excluded.
<!--END_NO_SYN-->
More
content
for
syndication.
<!--END_SYN-->
Both types of syndication comment tags are optional. But
they're available if you need them to specify or exclude
syndication content.
Making It Even Easier
Web masters who syndicate your content have it pretty good.
All they have to do is copy and paste once.
If you would like to make it easier for yourself, Master
Syndicator V4 from /a/27h/pl.pl?msyn
or Master Syndication Gateway I from
/a/27h/pl.pl?msg can do that for you.
No editing of the script, no comment codes in a web page,
just use the control panel to paste in the content you're
syndicating.
Question:
Did you find this article interesting and understandable? How can it be improved?
Your response is anonymous.
When done typing, click anywhere outside the box. [more info]
Will Bontrager
©2004 Bontrager Connection, LLC
Please note:
Articles on this website are presented "as is". However -
If you have a question about a CGI script, HTML, CSS, PHP, or JavaScript
Ask one of our Experts and you'll have your answer!
Click here for details.