[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

del.icio.us script

Subject: del.icio.us script
From: iwantto keepanon <iwanttokeepanon@xxxxxxxx>
Date: Mon, 18 Jul 2005 04:06:34 +0400 (MSD)
script delicious
I created an account on del.icio.us and used an import script to copy all of my Opera bookmarks into 
del.icio.us "post"s.  But instead of creating an XML representation in nested folders, it linearized 
all my folders into a string attribute called "tag".
 
I.e. the source structure:
   reference
      css
      javascript
      recipe
         tea
      isbn-books
         health
            fanatics
      colors

became:
   .imported
   .imported reference css
   .imported reference javascript
   .imported reference recipe tea
   .imported reference isbn-books health fanatics
   .imported reference colors

(in various random orders w/ multiple entries for each bookmark).

I already have a script that transforms Opera bookmarks into an HTML page (which is also my homepage), 
but now I wanted a similar one for del.icio.us bookmarks.

But the Muenchian grouping algorithm only seems to work w/1 key and 1 level.  I could create 5 keys 
anticipating a max of 5 levels, but that would require a bunch of if's and hack-ish XSLT programming.

I tried for a while with various bits of success, until I decided to use what I knew about the input 
set.  Which is all @tag(s) had the folder names in the same order and that a space seperated all 
folder names.  The above statement is only true b/c I use the same import script each time I sync my 
bookmarks or if I manually create a post I use care to make the above statement true.  I.e. add a post 
w/ tag name ".imported reference css" and not simply "css".

   Sample output : http://man-page.homelinux.org/~rodney/del.icio.us/bookmarks.html
   Sample input  : http://man-page.homelinux.org/~rodney/del.icio.us/iWantToKeepAnon.xml
   XSLT script   : http://man-page.homelinux.org/~rodney/del.icio.us/xml2html-key.xsl
   actual del.icio.us bookmarks : http://del.icio.us/iWantToKeepAnon/
   import script : http://www.hybernaut.com/bdv/delicious-import.html
      (mine is modified for Opera and skips "private" folders/URLs)

I think this solution is pretty good and I'd like some constructive criticism on how it could be 
better.  Also, I've seen some questions recently about grouping and I'm hoping that somebody else will 
find this useful to their programming.  Let me know, how'd I do?  How could this be better?

BTW, I am using Gnome's LibXSLT and LibXML from http://xmlsoft.org/

-- 
Rodney

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.