Xanga RSS

I always had a problem with Xanga RSS not working in NetNewsWire.

So I hacked up a solution in the form of a php file:

<pre><?
$f = escapeshellcmd($_GET["q"]);
$g = shell_exec('curl -s http://www.xanga.com/rss.aspx?user='
. $f . ' | sed -e "s/<rss version="0.91">/'
. '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/'
. '02/22-rdf-syntax-ns#" xmlns="'
. 'http://my.netscape.com/rdf/simple/0.9/">/"'
. ' | sed -e "s/</rss>/</rdf:RDF>/"');
echo $g;
?></pre>

And then I just call the script by subscribing to http://path.to/script/?q=username. It’s ugly, but functional.

A copy is also available for download.

9 thoughts on “Xanga RSS

  1. Simon's avatarSimon

    Or, without the shell,

    <?php
    echo str_replace(array('’, ”), array(”, ”), file_get_contents(“http://www.xanga.com/rss.aspx?user=”.urlencode($_REQUEST[“q”])));
    ?>

  2. Simon's avatarSimon

    Oops, I messed up the formatting on my previous post.

    Try this:

    >?php
    echo str_replace(array(‘>rss version=”0.91″<‘, ‘>/rss<‘), array(‘>rdf:RDF xmlns:rdf=”http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns=”http://my.netscape.com/rdf/simple/0.9/”<‘, ‘>/rdf:RDF<‘), file_get_contents(“http://www.xanga.com/rss.aspx?user=”.urlencode($_REQUEST[“q”])));
    ?<

  3. Simon's avatarSimon

    Blah. Messed up the tags. I’m retarded. Once more:

    <?php
    echo str_replace(array(‘<rss version=”0.91″>’, ‘</rss>’), array(‘<rdf:RDF xmlns:rdf=”http://www.w3.org/1999/02/22-rdf-syntax-ns#” xmlns=”http://my.netscape.com/rdf/simple/0.9/”>’, ‘</rdf:RDF>’), file_get_contents(“http://www.xanga.com/rss.aspx?user=”.urlencode($_REQUEST[“q”])));
    ?>

Comments are closed.