Post RSS feed w/o RSS-to-Javascript.com

S

Scott Gordo

I've got some Press Releases in an xml file I'm posting to a number of
different sites. I set it up as an RSS feed using
RSS-to-Javascript.com. Free and very easy to use, but frankly I'm not
sure the client is going to like the "Powered by:
RSS-to-Javascript.com" link at the bottom.

Can someone point me to a (concise) site/book/whatever that explains
how the RSS-to-Javascript thing works (or some other equivalent method)
so that I can take a crack at setting it up myself?

Thanks!

Scott
 
A

Andy Dingley

Scott said:
I've got some Press Releases in an xml file I'm posting to a number of
different sites. I set it up as an RSS feed using
RSS-to-Javascript.com.

This is a bogus approach, that came into being out of need and a narrow
gap in the technology low-hanging fruitbasket.

RSS has nothing to do with JavaScript and has no business being in
JavaScript. It's a static data format, not an executable. really you
ought to process inbound RSS on your server and serve it up as some
other data format for outbound (probably HTML). However this is hard
and there's an obvious demand for a simple "Just give it to me so I can
put in on MySpace" solution.

You can't have cross-server SSI, <iframe> is a bit limited even though
it's happily cross-server, but you can easily have cross-server
JavaScript. This is where these RSS-to-Javascript.com sites come in.
It's a hack, not an elegant hack, but it is a pragmatic and useful
hack.

OTOH, I think they're going to get squeezed soon, possibly squeezed out
of existence. Cross-site scripting attacks are a risk, and anything
that smells too much like phishing is likely to get itself firewalled
out pretty soon.

Can someone point me to a (concise) site/book/whatever that explains
how the RSS-to-Javascript thing works (or some other equivalent method)

- Take RSS from outside
- Load the RSS as XML (tricky!)
- Use XSLT (or other favourite tool) to transform the RSS into a
JavaScript program that does a lot of document.write()s of the
resultant content.
- Link the static "consumer" page to the generated script with a
simple
so that I can take a crack at setting it up myself?

If you're going to "set it up yourself", then don't set that up, set up
something better.

Rather than transforming RSS to HTML-embedded-in-JavaScript, just turn
RSS into HTML directly, then use it directly in your page. If you have
minor coding skill and a web host that allows some simple scripting,
you can do this. PHP is the entry-level for it and I'm sure there are
example scripts around.

Also search the obvious Usenet group archives, as we've discussed this
many times.
 
J

Jim Higson

Andy said:
- Take RSS from outside
- Load the RSS as XML (tricky!)

Why tricky?

In PHP there is a built-in XML DOM parser that isn't too difficult to use.
Then you could output HTML from a bunch of PHP loops and things.
Presumably, other scripting languages have similar abilities.

You could also call something like xerces to be an XSLT. It's only a system
call to call it at the command line. You have to be careful security-wise
with this, but the execution isn't difficult.

Just curious, but why is this tricky to do?
 
A

Andy Dingley

Jim said:
Just curious, but why is this tricky to do?

RSS isn't XML (for most of the non-RDF versions - read their spec!).
There is no XML-valid RSS 2.0 as there's no way to define validity for
it. Practical RSS is also very frequently not well-formed RSS -
references to HTML entities being the usual culprits.

If you try to load RSS through an XML parser, then unless you're just
dealing with RSS 1.0 and Atom feeds, then you'll regularly find parsing
errors. A practical real-world RSS aggregator has to cope with this,
without failing.
 
J

Jim Higson

Andy said:
RSS isn't XML (for most of the non-RDF versions - read their spec!).
There is no XML-valid RSS 2.0 as there's no way to define validity for
it. Practical RSS is also very frequently not well-formed RSS -
references to HTML entities being the usual culprits.

If you try to load RSS through an XML parser, then unless you're just
dealing with RSS 1.0 and Atom feeds, then you'll regularly find parsing
errors. A practical real-world RSS aggregator has to cope with this,
without failing.

Thanks for the heads-up. Interesting how bad the situation is. I'd have
imagined it was plain XML and pretty easy to parse as such.
 
C

caddcreativity

I've used http://www.bloglines.com to add RSS feeds to my sites there
and setup javascript in my website to search bloglines for the input
term.

The code below works perfect, but I have 2 minor issues, hopefully
someone more family with javascript can help me out with.

1) the variables do not reset, so any future searches return the same
previous returned link, unless i clear settings/cookies.

2) there is a static-string i would like to append: [&m=enh&usr] to the
end of the URL

{CODE}

<script language="JavaScript">
var name = "<person/>";
<![CDATA[
function Popup(){
var rssURL = "http://www.bloglines.com/search?q=";
var winWidth=800;
var winHeight=600;
var winScrollbars="yes";
var winToolbar="yes";
var winSizeable="yes";
var winLocation="yes";
var winDirectories="yes";
var winStatus="yes";
var winMenubar="yes";
var winCopyHistory="yes";
newWin=window.open(rssURL+name,"",
"copyhistory="+winCopyHistory+
",menubar="+winMenubar+
",status="+winStatus+
",directories="+winDirectories+
",location="+winLocation+
",resizable="+winSizeable+
",toolbar="+winToolbar+
",scrollbars="+winScrollbars+
",height="+winHeight+
",width="+winWidth);
}
]]>
</script>
<a href="javascript:popup()"><person/></a>
{END CODE}

I also am currently working on XLST to format various feeds for various
purposes.

Hope this helps.

Any return help would be greatly appreciated.

CADD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top