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

Discussion in 'HTML' started by Scott Gordo, Aug 1, 2006.

  1. Scott Gordo

    Scott Gordo Guest

    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
     
    Scott Gordo, Aug 1, 2006
    #1
    1. Advertising

  2. Scott Gordo

    Andy Dingley Guest

    Scott Gordo wrote:

    > 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
    <script src="..." ></script> element.


    > 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.
     
    Andy Dingley, Aug 1, 2006
    #2
    1. Advertising

  3. Scott Gordo

    Jim Higson Guest

    Andy Dingley wrote:

    >> 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!)


    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?

    --
    Jim
     
    Jim Higson, Aug 2, 2006
    #3
  4. Scott Gordo

    Andy Dingley Guest

    Jim Higson wrote:

    > 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.
     
    Andy Dingley, Aug 2, 2006
    #4
  5. Scott Gordo

    Jim Higson Guest

    Andy Dingley wrote:

    >
    > Jim Higson wrote:
    >
    >> 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.


    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.

    --
    Jim
     
    Jim Higson, Aug 5, 2006
    #5
  6. Scott Gordo

    Guest

    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



    Scott Gordo wrote:
    > 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
     
    , Aug 29, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tom pester
    Replies:
    1
    Views:
    1,049
    clintonG
    Aug 31, 2005
  2. Replies:
    5
    Views:
    822
    SpaceGirl
    Feb 25, 2005
  3. Motta
    Replies:
    1
    Views:
    580
    Andy Dingley
    Jun 9, 2004
  4. Jonathan Groll
    Replies:
    1
    Views:
    323
    Kouhei Sutou
    Jun 27, 2009
  5. Rainmanjam

    Javascript in an (Geo)RSS feed

    Rainmanjam, Jan 28, 2008, in forum: Javascript
    Replies:
    5
    Views:
    147
    Rainmanjam
    Feb 1, 2008
Loading...

Share This Page