"Mario Menti" <[EMAIL PROTECTED]> writes:

> What do you do when you want to open source, but there is no code? You
> create your own scripting language! So, in the open source spirit, here's
> how I created my tag cloud:
>
> [code]
> maintab = webbrowser.opentab("http://www.tagcrowd.com";);
> newtab = webbrowser.opentab("
> http://www.mail-archive.com/backstage@lists.bbc.co.uk/";);
> subjects = newtab.copy(subjectlines);
> maintab.paste(editext[0], subjects);
> maintab.blacklist({"re","mr","hi","hello"});
> result = maintab.button["Visualize!"].press();
> tagcloud = result.copy(edittext[0]);
> myblog = webbrowser.opentab("http://menti.net";);
> mynewpost = myblog.createnewpost("bbc backstage tag cloud t-shirt",
> tagcloud);
> mynewpost.save();
> mynewpost.mailto("backstage@lists.bbc.co.uk");
> [/code]

Thats' pretty cool. Here's the first part in unix:

   xsltproc --html tshirttagcloud.xslt 
http://www.mail-archive.com/backstage@lists.bbc.co.uk/ |\
         awk '{for(i=1;i<NF;i++) if ($i !~ /[rR][eE]:/) print $i}'

My stylesheet:

  <?xml version="1.0" encoding="utf-8"?>
  <xsl:stylesheet  version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
    <xsl:output method="text"/>
    <xsl:template match="/">
      <xsl:apply-templates select="//[EMAIL PROTECTED]'subject']"/>
    </xsl:template>
    <xsl:template match="text()"><xsl:text> </xsl:text><xsl:value-of 
select="."/><xsl:text> </xsl:text></xsl:template>
  </xsl:stylesheet>

I don't do the second part (generating the tag cloud) but there are
lots of options:

- do it in xslt:
  http://cse-mjmcl.cse.bris.ac.uk/blog/2006/08/08/1155058345613.html

- spit out to some unix pipeline that gens tagclouds (perl?)

- spit out to curl and have curl call tagcloud


-- 
Nic Ferrier
http://www.tapsellferrier.co.uk   for all your tapsell ferrier needs
-
Sent via the backstage.bbc.co.uk discussion group.  To unsubscribe, please 
visit http://backstage.bbc.co.uk/archives/2005/01/mailing_list.html.  
Unofficial list archive: http://www.mail-archive.com/backstage@lists.bbc.co.uk/

Reply via email to