Publishing Quick Links in blosxom with del.icio.us via xmlstarlet
In case anyone is interested in using del.icio.us with blosxom in place of my own BookmarkBlogger, get yourself a copy of xmlstarlet and check out this shell script:
!/bin/bash
DATE=${1-date +%Y-%m-%d
}
BLOG="/Users/deusx/desktop/decafbad-entries/links"
FN="${BLOG}/"echo ${DATE} | sed -e 'y/0123456789-/oabcdefghij/'
".txt"
curl -s -u deusx:HAHAHA 'http://del.icio.us/api/posts/get?dt='${DATE} |\
tidy -xml -asxml -q -f /dev/null |\
xml sel -t -o "Quick Links" -n \
-e 'ul' -m '//post' \
-e 'li' -e 'a' -a 'href' -v '@href' \
-b -v 'text()' -n > ${FN}
touch -d "${DATE} 23:59" ${FN}
You could do this with XSLT, but hacking with a REST-ish & XML producing web service entirely in a shell script seemed oddly appealing to me that week. Extending this sort of thing to blogging systems other than blosxom is left as an exercise to the reader.
Update: Hmm, looks like one of the blosxom plugins I'm using hates the variables in my code above. So I stuck curly braces in, which seem to get through okay.
shortname=delicious_quicklinks
Archived Comments