Import your del.icio.us bookmarks into Google #

Update on 12/18/2010: I've updated the tool to handle the V2 Delicious API.

I've written a simple script/site that lets you import your del.icio.us bookmarks into Google's bookmarks feature (which doesn't seem to have a product name - oh, right):

http://persistent.info/delicious2google/

Technical Details

For a while now, Kushal* had been wanting a way to import his del.icio.us bookmarks into Google. There are some advantages to this, including the fact that your tags labels show up in search results if they contained a bookmarked site and one-click Toolbar access. It was pointed out to me that the bookmarks site has a POST/XML-based bulk import interface that the Google Toolbar uses to import IE Favorites. I initially thought that I could use del.icio.us's JSON API to get the list of bookmarks, thus having a completely client-side solution that did not require the user to hand over his/her credentials. Unfortunately that turned out to be limited to 100 posts. Hack-ish workarounds came to mind, like getting the list of tags first and then getting the bookmarks for a particular tag (still wouldn't work if there were more than 100 bookmarks for a single tag). I abandoned that approach, but for the sake of posterity, that version is archived here.

Since del.icio.us also has a REST API that allows full access to data, my next thought was to use that. pydelicious is a pretty simple to use Python library for accessing the API, and it was easy to create a script that used it to fetch the list of bookmarks for a user. Since I already had the code from my previous attempt that took the JSON output and uploaded it, I merely made the Python code output similar JSON and used the same upload method.

This approach seems to work pretty well, but it has the caveat that the user has to enter their username and password into a third-party site. I've provided the source code so that the paranoid can run their own copy. While the Google bookmarks site doesn't have an API per se, it does export its data as RSS feeds thus this does not have to be a one-way transfer; an enterprising hacker could write an importer in the other direction.

* His newly-released luxur(n)y site is interesting if you're in the market for a NYC luxury rental.

84 Comments

You rock! How about integrating Google Reader's Shared Items with Google Bookmarks next? :-) That's the only thing that stands between turning Google Reader/Bookmarks into a del.icio.us replacement for me. -ian
Hmmm...looks like it only imported 36 of my bookmarks.
Is there any particular reason this couldn't be implemented for Digg bookmarks? I'm not trying to be lazy, I'm wondering if you've checked it out before I attempt to do it myself.
Any chance of getting this to import descriptions? Also back dating of bookmarks to the dates they were saved in Del.icio.us?

If only Google Bookmarks were sharable...
I really wished Google Bookmarks would be fleshed out into a full delicious style site. Right now it's very limited. Heres hoping its the next Google product that gets some real attention.
Works nicely. Now if these bookmarks would be used for search personalization.. Maybe once you guys have enough CPU to calculate a page rank per user :)
if you feel unsafe about revealing the password, you can just change it for the time the import is running and revert it back to the original afterwards.

Nice script!! Though I have 630 items in delicious and only about 70 were imported ... any idea what to do?

thanks!
I was able to import quite a few bookmarks, but not all. I will keep an eye here to see if there are any updates.
Great script!
I completely agree with the first post by Ian. Google reader must be integrated with Google Bookmarks, particularly the shared items. Also, there should be a bookmarklet which lets you tag and share the article AFTER you have read it. It doesn't make sense to share a feed when all you've read is the headline and a paragraph.

Jonathan
Jonathan: Agreed. And if Bookmarks and Reader were integrated, you could just use the existing Bookmarks bookmarklet to do that. -ian
Another thing, I'm in love with your Smart Google Reader Subscribe userscript. Perhaps a similar script for Google Bookmarks. Anyway, thanks.
Reader and Bookmarks would be great together!

I've been using Reader regularily since it started, and I use stars for quick scanning (a "to read" list to return to when I don't have time to do it). However, I also keep my interesting links there, for tranferring to del.icio.us. If I was using Bookmarks and the feed items had an easy link to add to it, life would be great.
Oh. I had no clue about Google Bookmark's XML importing interface. Thanks so much for the info, Mihai!

Btw, I threw this into an almost one-step bookmarklet that keeps bookmark and login data client-side. With it, one need only visit delicious' export page and click the bookmarklet to sync everything.

http://blog.lifeslip.com/articles/2006/10/25/bookmarklet-delicious-google-bookmarks
I would really like to import del.icio.us bookmarks into Google Bookmarks and keep my notes/descriptions intact.

I don't know enough about Python scripting to edit your script and run it myself, but I played around a bit with the del.icio.us and Google Bookmarks APIs in order to figure out how they work.

If you map the contents of the attribute "description" as output from the del.icio.us REST API into the Google Bookmarks attribute "annotation," the notes should be transferred. ("&annotation=" is the string that will add notes when part of a bookmarklet; I'm using "&annotation='+getSelection()" to set the notes field to the current selection in the bookmarklet I'm currently working on).
By the way, if you do update your import script, it would be really cool if you could find a way to transfer the "time" del.icio.us attribute so that the date bookmarks were added could be moved over as well. I'm not sure that it would have a corollary in the Google Bookmarks import interface, though.
Argh... sorry for the triple-post. I just looked at the del.icio.us API again, and the "extended" attribute is the one that should end up as notes in Google Bookmarks. "description" is just the link title, as you no doubt already know.
Brad, unfortunately it looks like the Google Bookmarks import interface does not pass through the description.
Anyone know why the RSS feed for each label only calls up the first 15 bookmarks?
I'm developing an application for importing and exporting Google bookmarks from text strings and find this article very helpful in getting the Google interface. I don't see the Google interface in your latest python code, but in your "abandoned" approach I was able to see the XML tags used in sending bookmarks to Google. Your "abandoned" approach results in another Google window which asks for confirmation ("do you really want to import these"). By pusing the "Import" button and using tcpflow I was able to find out the interface which will "just import" the bookmarks in one step; you can skip the confirmation. This shortcut is that you send an HTTP POST to:

"http://www.google.com/bookmarks/mark?op=upload_selection&hl=en&zx="

The body of the post begins with:

q=&s==Import

and then you follow this by any number of bookmark data streams, like this one:

&bm_1=X&url_1=&ttl_1=&lbl_1=

The next one is bm_2, url_2, ttl_2, lbl_2, etc.

This all seems to work fine, except that I cannot figure out the tag used to import the fourth and final field, the "Notes" or "Annotation" for each bookmark. You don't have that in your code. I've tried ano_1, ann_1, not_1, etc. No luck!

In the RSS feed of bookmarks that comes back from Google, I see that they use the longer name "annotation", along with the "label" and "title", but I tried "annotation", "note" and "annotations" in your "abandoned" code but these don't work either.

Do you know what tag might be used for "notes" or "annotations"??

By the way, parsing the RSS to read the bookmarks is easy, like you said. I've also figured out how to delete bookmarks. So this is the last lilttle piece I need to have a complete Google Bookmarks importer/exporter!

Jerry Krinock
San Jose, CA USA
Argghhh! I just noticed that blog ate up some of the symbols in those two lines of code my previous post because it thought they were html tags. Here's what they should be:

q=&s=signatureFromRSSHeaderItems=Import

&bm_1=X&url_1=urlOfBookmark1&ttl_1=titleOfBookmark1&lbl_1=commaSeparatedLabelsOfBookmark1

Jerry
After reading the comments above by Kevin, Brad and doing further investigation, I agree with Mihai that there is no tag in the "Import Bookmarks" interface supporting import of "Notes". There is an obvious reason ro this: It appears that this "Import Bookmarks" interface which Mihai has exploited was designed by Google for importing "Internet Explorer" bookmarks. Since Internet Explorer does not support "Notes", there is no reason to support importing of them. Argghhhh!!
By the way, the previous post was mine. Forgot to enter my name. Regarding Eric's question, I'd say the answer is because 15 is the number of bookmarks you get on a page when you load google.com/bookmarks. So, now we need to figure out how to get the rest of them....
Ah, that was easy! Simply append the query item start=15, start=30, etc. to successive requests. To see how it works, if you have more than 15 Google bookmarks, enter this in to your browser's address field:

http://www.google.com/bookmarks/lookup?start=15&output=rss
Worked like a charm. Looks like all of my bookmarks transferred over. Thank you!!!
I just discovered one other thing about that RSS feed of bookmarks you get from Google (when "exporting from Google"). The header says

encoding="utf-8"

but the accented "e" (as in "San Jose") comes to you as a single byte, 0xE9. That aint' UTF-8!!! So, I have to hack into it and replace that with

encoding="windows-1252"

and now my XML parser is much happier.

Since Google Bookmarks is not a public API, there is no place to discuss it on Google; this seems to be the only place where people are interested!
Imported 1151 bookmarks. sweet.
Jerry, thanks for noticing that encoding bug. It should be fixed now, according to the Search History team.
thanks for the script/service... it rocks.
Thanks for the script!
Hi,

This is about the third time I am trying to upload my delicious to Google Bookmarks. But it just displays the "Uploading" page (after I give the delicious userid and pwd) and nothing much seems to happen after that.

My Google Bookmark count still remains at 4 (those 4 are the manually added ones).

Any idea what could be the reason?

I have close to 1000 items in delicious. Also, it would be very helpful if it can display some status message like "uploading 1 of 1000" etc. At least, the people who are uploading would know what is happening.

Thanks so much for the great blog and all the great greasemonkey scripts that you have written over the last few years.

Regards,
Proto, India.
I've written a script which will do exactly the opposite - ie move bookmarks from Google to del.icio.us, that is. :-)

It's a command-line Python program which can be run from your desktop. You can grab it here - http://code.google.com/p/gbookmark2delicious/
Having the same problem Proto describes above. Enter username and password and the page just reads "Uploading..." and nothing further happens.

Tried both Firefox and IE.
having the same problem as Proto.
hope it coгдв be fixed.

Alex
Me three. (Actually, it imported a single del.icio.us bookmark for me, of 1000's, and then subsequent attempts result in the hung "Uploading..." page.)

I'm not complaining -- this is free code, after all, and I'm not jumping up to debug it. But FYI.
Thank you very much! I just imported my bookmarks (1000+), and (I think) they were all copied properly. I love it!

If it would be possible to have Google reader be able to interact with your favorites so you would have the easy option of adding the feeds from one section to the other. (^_^)
Wow, this is too cool man. You Rock!
wow this is easy and works fast I ma very impressed
Me four...I see the Uploading Page and the Progress Bar on my Browser increases, but when it's finished it takes me to the Gmarks Import Page but no Bookmarks are listed there.
Is there a way to Synchronize your Bookmarks in del.icio.us Google Bookmarks and your Browser including the date of publishing, associated tags notes and frequency of visit.

del.icio.us lets you share your Bookmarks but doesn't have the capability that Google Notebooks integration with Google Bookmarks offer.

With Firefox 3 supporting tags it will be really useful.

I am currently looking for ways to at least synchronize the Bookmarks including the associated tags between Google Bookmarks and del.icio.us

I have both the del.icio.us adon and all the Google adons for Firefox (Google Browser Sync, Google Notebook Ad-on, Google Toolbar which includes Bookmarks but can't find a way to synchronize the Bookmarks.)

The reason I am looking at it is that I realized just now that all your Google Bookmarks are already accessible from your Google Notebook. It would be amazing to have notes for everything you find on the Web..

Your script helped a lot..

You may consider an ad-on for Firefox3 as they are implementing tags so I guess a lot of interoperability issue will be resolved.

Thanks for the Script...

And the best part was that you managed to get this done without taking the Google Account info.

In the first page where the Script asks for your del.icio.us login info I was a little worried thinking that I might need to provide my Google Account information but then the Transparency that you demonstrated by providing the full source code of what will get executed in teh Server did give me a lot of confidence in your Script.

Also needless to mention no redundancy of bookmarks a s it filters already existing bookmarks, with the option to choose which bookmarks you want to import

Thanks man..
You can also consider making a few tweaks to merge the new Tags being added to ignore case sensitivity and singular/plural things which I think is one of the biggest Problem with folksonomy.

Also the fact that Google allows you to have multi word tags whereas del.icio.us doesn't is again an interoperability issue.

Bye the Way I read the last para of the post after importing my bookmarks and posting my last comment. SO you can probably understand my concerns on the Login info issue. :)
Fantastic! That worked like a charm with no problems at all. Great job.
Simple way to search on sites saved on del.icio.us - use deliGoo (www.deliGoo.com). deliGoo can create custom search engines by your demand from any del.icio.us user's bookmarks and/or tag.
It is really annoying to not be able to upload the annotations / notes. I can't believe Google left this out of their op=upload code.
Is it possible to add a feature so if bookmark already exist then your scripts add labels available in Delicious?

Thanks!
am i able to do the same with simpy.com? simpy does also use REST API
for some reason, when i enter my username and password it shows the import bookmarks page with the list of bookmarks to import and then it refereshed automatically and the list of bookmarks that appeared before doesn't anymore
I'm having the same problem as pratik....
works fine until upload repeatedly stops after importing 568 bookmarks
thanks alot XD
I still really want to do this, but without transferring my notes about each link it's worthless to me. It would also be cool to transfer the dates each one was originally bookmarked, but that's less important.
After disabling NoScript's XSS feature to allow a cross-site request-or-whatever, it doesn't work because it just brings me to my "Import bookmarks" page in Google Bookmarks after nothing's happened.
Hey, great application, only problem is that as of now all Delicious accounts are in the process of being integrated with Yahoo accounts.

Does this interfere with your app? I am asking because I am one of those who already integrated his Delicious profile with Yahoo, and I tried your app but it didn't work. Error message was: "Error talking to del.icio.us
".
I'm also getting the eternal "Uploading" page, with nothing happening otherwise. Happening in Firefox, IE and Chrome. I have roughly 2800 bookmarks in delicious, and I waited an hour.

Any ideas why this isn't working?
Great app, but it only grabs 626 of my 2500+ Delicious bookmarks. I've been using Delicious since October of last year, so some of the bookmarks are pretty old. Could this be causing it? Any way to fix? I'd love to move everything to GB if possible.

Thanks for putting this together -- even though it's not grabbing everything, it's a lot better than having to move these bookmarks by hand!
Same error as Davide here. "Error talking to del.icio.us" - I use a yahoo account as well.
I'm also having issues with the "Error talking to del.icio.us". I am not using a yahoo account.
The "Error talking to del.icio.us" with Yahoo! accounts is possibly due to the Great Delicious Yahoo Login Disaster of 2009, which you can read about here:

http://developer.yahoo.net/forum/?showtopic=3065

But there may be another problem caused by a change during the past week at Google. The python script which runs on Mihai's server, http://persistent.info/delicious2google/import.py.txt, contains an HTTP Post submission to http://www.google.com/bookmarks/mark. Try changing the scheme in there from http to https. That fixed the problem in my apps Bookdog and BookMacster. I'd be interested to know if someone can confirm this.
Really interesting; it's a shame that Google Bookmarks doesn't have an API :(

what would you think about a service like this?:
http://www.favoritious.com
Having similar trouble with the eternal Uploading.. screen with zero success.

I wonder what the deal is? Why wouldn't Google have actually made a tool for this?
Great initiative, but I just can't get it to work. I have 1900+ bookmarks on Delicious but only 124 are imported using this script, even after multiple attempts.

I see other people having the same problem. Anyone know of a solution?

Thanks.
I got:
Uploading...
and then
Error talking to del.icio.us

The source code of the pages does not give much more info:

[the blog does not accept the code, but it said almost nothing]

How can I help debug this?

I tried both firefox 3.6 and chrome 4.1
Hi,

Import worked great after I renamed a problematic title:

,"d":'Open Source Web Design - Design or Not? /\^/\'

i removed the /\^/\ as it gave me a javascript error (unterminated string literal)
I've the same problem by importing to Google.

"Error talking to del.icio.us"

Is there something to fix? I only have 400+ bookmarks and it doesn't work. Very sad.
me 10th probably with same problem,
"Uploading...."
and
"Error talking delicious "
without any result at all
*(SOLVED)*
"Uploading..." error is there due to a very lengthy description in any of your bookmark in delicious, or it could be any non standard script.
You must identify that bookmark that is causing error, to do so i used 'firebug' extension for firefox.
I used it on del2google page, it showed the error in one line that a string is not properly terminated in 'e' line, (developer can solve this problem). I searched that bookmark in delicious and deleted and problem solved :)
Thx, it works so fast and simple. I confess, I changed the pass before and after the use of your script, but it's some paranoid move... Anyway, great job!
sorry but this is not working! at first i was moved to google bookmarks, thy told me "nothing to import" and now i got the "Error talking delicious" problem. (after several attempts)
i have tried to fix bookmark descriptions in delicious but no success! :-(((

is there anything i can do?

reg,
kasi
Nowadays Delicious login via Yahoo login. So the script doesn't work anymore.
Wow! I'm amazed this works. Thought it might be dodgy so changed my delicious password first. There was no need. Nothing dodgy, it just works. Thanks.
Now that delicious is closing down and people are scrambling to find a new bookmarking site, this tool would be VERY useful if it worked...I keep getting:

"Uploading...
Error talking to del.icio.us "

halp! :/
Ditto this: Now that delicious is closing down and people are scrambling to find a new bookmarking site, this tool would be VERY useful if it worked...I keep getting:

"Uploading...
Error talking to del.icio.us "

halp! :/
@Martin

Really??

delicious is closing Down??

SAD!! It had been a Good companion in my journey on the Web..

@rungss on Twitter
I've knocked up a bookmarklet to upload a Delicious export to Google Bookmarks, including tags.

Give it a whirl... http://andyhitchman.github.com/DeliciousToGoogleBookmarks/
Nice work. I've been trying to get Mihai's scripts to work for a while and thought I had finally concluded that the Google Bookmarks XML bulk upload was no longer supported. But, apparently it is. Thanks!
Uploading...

Error talking to del.icio.us


Can u fix this?
http://andyhitchman.github.com/DeliciousToGoogleBookmarks/

Awesome ! It works ! Any way to add an enhancement to import the "notes" from delicious too? Thanks though, everything else worked flawless.
I've added basic v2 API support (which is needed if you've merged your Delicious account with your Yahoo! ID) to http://persistent.info/delicious2google/. I'll update the post once I get some confirmation that it works for other people.
Thanks it's working now! :)
It would be great if your tool would import the publish date or "time" that is listed in the xml file. Maybe the Gmarks import tool doesn't allow it?
@Anonymous: Yes, the Google Bookmarks importer currently doesn't support dates (they're aware that it's a requested feature).
Thanks a lot!, it worked right, you've saved me :)
Suggestion related to dates. I realize that dates are not imported, however would it seems like it would be simple to have the script extract or insert the bookmarks in reverse order so that the newest bookmarks in Delicious remain the newest in Google Bookmarks (time stamp wise)? My current pass at importing has my most current bookmarks in Delicious as the oldest in gBookmarks.
I tried using the application today with my Yahoo-linked delicious account and all i get in google chrome browser is "Uploading"... and a bunch of JSON data.

I am using google chrome version : 14.0.835.186 m

I also tested this out with Firefox 6.0.2 and getting the same results were the JSON data of the application is directly shown on the webpage.

Post a Comment