Please note the methods and code discussed here have been superseded by the Scripted Re-Mark batch editing tool.
First off, the transition on Blogger's end was surprisingly easy: change the settings on the Publish page, nominate a new blog address and re-publish. Easy-peasy. (OK, there was a slight hitch with the baffling failure to re-publish initially when Blogger informed me 004 dk.eos.net.FtpError: Login incorrect.. A spot of googling turned up the explanation and very simple fix.)
Next, I needed to ensure my delicious bookmarks pointed at my shiny new Blog*Spot domain. "Why", I thought to myself, "delicious is the premiere bookmark manager - surely updating several hundred links will be a hassle-free pleasure". Hardly. Maybe it's just that I'm an idiot, maybe I just had too big a weekend but, darn it, I couldn't for the life of me figure out how I could effect such a change!
The solution I came up with was to export my bookmarks (as an HTML file), make the simple changes to the URLs of bookmark posts (including archives) via the search-and-replace feature of my text editor (no regular expressions required) and finally re-import them back into my account.
Not bad, I guess. Clumsy, but feasible. I'd give it a C. Then I hit the first hitch.
Hitch #1. Delicious does not support batch delete.
Before I re-import the updated bookmarks, I thought I should delete the old ones. (Delicious can't overwrite them, since it uses the URL - which would have changed - to identify the bookmarks. I would have ended up with both sets, making my job even harder!) I googled around, checked out the API (which needed URLs) and looked at third-party libraries without joy. I resigned myself to clicking the delete button (plus confirmation) several hundred times.
Hitch #2. Delicious will block you if you generate requests too quickly.
Using my patented whirlwind mouse techniques, I was deleting posts off the page at a rate of one or two a second. Delicious does not like this. It will cut you off and lock you out for some ten or fifteen minutes. Apparently, you need to use a delay of ten seconds or more. OK, I could accept five minutes of furious clicking, but counting "one cat-and-dog, two cat-and-dog ... ten cat-and-dog" between clicks would take ages. Not cool.
Peering into the delicious page, I thought I could automate the whole painful process with a bit of javascript (see Code #1 at the end of this post). The idea is to grab all the "delete" links on the page and open them (with a suitable delay) in new windows. Sure, it coud be nicer (perhaps removing the popups), but it works. Just paste the code into your browser bar and press enter. Be warned: it will delete every post on the page, so make sure you are looking only at posts you want to have disappear. (Tip: make sure your browser allows popups on this page!)
Moving along now, I began the import process. Strangely, this takes up to half an hour after you upload the file. Goodness knows why. But, it worked as advertised, retaining tags, notes, dates and even my bundles. Except ...
Hitch #3. Delicious imports are compulsorily marked "not shared".
This means that no one else can see them - and presumably you can't use them to categorise your blog! Again, I couldn't see any mechanism to turn them all off in one hit (and yes, I don't "allow private saves" in my options). This time, I had to have a closer peek at the Ajaxy goodness in the delicious page and, after butchering one of their functions, managed to figure it out. (Please check out Code #2 below.) Paste this code into your browser bar and it will go through the current page, systematically triggering the "shared" option for each post (waiting politely in between).
Finally, it all worked. I was able to get away with a delay of as little as five seconds in both scripts, but I suggest you try it yourself. Even still, allowing for pagination and the various steps, the whole thing took an hour to process some 200+ posts and 40 archive pages, albeit mostly not requiring my attention.
And, yes, if I'd known what was involved I probably would have knocked together a variant on Code #2 to use the post edit function to sequentially edit the URL of each post on the page ... ahhh, the wisdom of hindsight.
So, at the end of this arduous task, I'm left in some doubts as to delicious' claim to be a bookmark manager (as opposed to repository) given the lack of support for basic batch-mode updating, deleting and reloading functions.
Does anyone have some pointers to share on this topic? Is there a secret batch-mode facility available? Has someone knocked together a web-app for doing this? It'd be great to save others the pain of doing this.
Code #1. For deleting (via popups) your delicious posts.
javascript:var delay=10000; var l=new Array(); var a=document.links; for(var i=0; i<a.length; i++) if(a[i].href.search('delete')>0) l.push(a[i].href); alert(l.length); count=0; doPopDel(); function doPopDel(){ window.open(l[count],count,''); count++; if(count<=l.length) setTimeout(doPopDel, delay);}
Code #2. For sharing (via AJAX) your delicious posts.
javascript:var delay=10000; var l=new Array(); var a=document.links; for (var i=0; i<a.length; i++) if(a[i].className.search("share")==0) l.push(a[i]); alert(l.length); count=0; doShareDel(); function doShareDel(){ sharePostYes(l[count].parentNode); count++; if (count<l.length) setTimeout(doShareDel, delay);} function sharePostYes(confirm){ commands = nextElement(confirm), post = confirm.parentNode, share = $('.share', post)[0]; remove(share.previousSibling, share, confirm, $('.private', post)[0]); commands.style.display = 'inline'; var data = getPostData(post); var postBody = 'jump=no&format=none&private=0'; var fields = { description: data.desc, url: data.url, oldurl: data.url, date: data.isoDate, notes: data.notes, tags: data.tags, key: data.key}; for(var i in fields) postBody += '&' + i + '=' + encodeURIComponent(fields[i]); var url = 'http://' + location.host + '/' + Delicious.cuser; new Ajax({url: url, method: 'post', postBody: postBody });}
In both cases, copy and paste the code into the address bar of your browser when you have loaded the appropriate delicious page. Set "delay" to be the duration (in milliseconds) to wait between requests (5-15 seconds should do it). The first alert box is the number of posts it's found. Good luck!
Filed in: blogtech del.icio.us, tagging, blogspot, freshtags, how-to
U r the guru of gurus
man of men
u have released my bookmarks from the prison of loneliness
a salute and a hat tip to u
Have you checked out Scripted Re-Mark? It has support for setting your bookmarks free, plus other stuff.
-Greg.
This way the script notifies you when it's done with the page.
x =
if(delicious = not shared, +1;otherwise:exit;) hours
Thank you!
That's just what I needed! More!...you should be proud!
hats off !!!
You rule.
Hey! I think I brought delicious down!! I get 999 Yahoo Page..
hhehe.. Thanks
cheers!
"Problem deleting item: No such item for deletion. Try to delete this item again? Yes No"
but from the address bar I could see it was the same item I had just selected to delete.
this actually made it more time-consuming than using the one at a time deletion on the Delicious page. I was so hopeful for your code.