careck

is the screen name of Carsten Eckelmann.


 package require base64
 package require http
 package require tdom

 proc delicious_get_all {username password} {
   set auth "Basic [base64::encode $username:$password]"
   set headerl [list Authorization $auth]
   set tok [http::geturl http://del.icio.us/api/posts/all -headers $headerl]
   set res [http::data $tok]
   http::cleanup $tok
   set pdoc [dom parse $res]
   set plist [$pdoc selectNodes //post]
   set posts {}
   foreach p $plist {
     lappend posts [list [$p getAttribute href] [$p getAttribute description] [$p getAttribute tag] [$p getAttribute time]]
   }
   $pdoc delete
   set posts
 }

 proc delicious_select_by_tag {dlist dtag} {
   set rl {}
   foreach p $dlist {
     set found 0
     foreach d $dtag {
       if {[lsearch [lindex $p 2] $d] > -1} {
       incr found 1
                        } else {
                                incr found -1
                        }
                }
                if {$found > 0} {
                        lappend rl $p
                }
        }
        set rl
 }