http://www.perlmonks.org?node_id=129187


in reply to PM Frontpage Panel for Opera (and others?)

Heh, that was the first thing I did when Opera 6 was released! :)

Basically, I grab the Newest Nodes XML ticker, munge it with a XSL stylesheet (with xsltproc, from the GnomeXML lib) to make it look like a clean RDF, and feed it to Opera's panel displayer. I update the page every 15mn or so.

If I remember correctly, there was only a problem with namespacess in the XML output by PM which prevented it to be directly understood by Opera's panel displayer.

Crontab entry
/usr/bin/lynx -source \ http://www.perlmonks.org/index.pl?node=newest%20nodes%20xml%20generato +r | \ /usr/bin/xsltproc /usr/local/apache/htdocs/stylesheets/headline.xsl - +\ >/usr/local/apache/htdocs/headline.rdf
The headline.xsl stylesheet

It's a quick hack, and probably not the best way to do it.

<?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="NODE"> <xsl:if test="position() &lt; 22"><!-- position() is weird --> <item> <link><xsl:text>http://www.perlmonks.org/?node_id=</xsl:text>< +xsl:value-of select="@node_id" /></link> <title><xsl:value-of select="." /></title> </item> </xsl:if> </xsl:template> <xsl:template match="/"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://my.netscape.com/rdf/simple/0.9/"> <channel> <title>Perl Monks</title> <link>http://perlmonks.org/</link> <description>Your site for all that is Perl</description> </channel> <image> <title>Perl Monks</title> <url>http://perlmonks.org/images/perlmonkssm.gif</url> <link>http://perlmonks.org/</link> </image> <xsl:apply-templates/> </rdf:RDF> </xsl:template> <xsl:template match="INFO" /> <xsl:template match="AUTHOR" /> </xsl:stylesheet>
Opera's Panel
Opera's panel display
<kbd>--
my $OeufMayo = new PerlMonger::Paris({http => 'paris.mongueurs.net'});</kbd>