Disclaimer: You are looking at a post I wrote some time ago. The information and opinions contained within may be outdated and may differ from my current views. Please proceed accordingly.

Export Firefox Bookmarks to Delicious

Nov 09, 2004 5:18 PM
Tags:

update Here's the change I made, to lines 75-76:


# convert bookmark time to ISO time
try:
    isoTime = strftime("%Y-%m-%dT%H:%M:%SZ", gmtime (int(item.getTime())))
except:
    isoTime = ''

Props to Elliot Smith for his Python scripts that automate transferring bookmarks from Firefox to Del.icio.us.

I had to make a minor tweak — it couldn't handle some of the bookmark dates, so I did a try/except that set them to '' — but it saved me a lot of time and trouble.

Thanks for sharing the hack.


Comments: Export Firefox Bookmarks to Delicious

Joe,

what was the tweak you made? Thanks...

Posted by: Marcus on November 10, 2004 6:40 AM | permalink

Check the updated post.

Posted by: Joe Grossberg on November 10, 2004 7:01 AM | permalink

How should the indentation work? Sorry, I'm new to Python.


C:\Documents and Settings\marcus.mattila.SYSOPEN\Desktop>c:\Python23\python.exe
BookmarksToDelicious.py "C:\Documents and Settings\marcus.mattila.SYSOPEN\Applic
ation Data\Mozilla\Firefox\Profiles\default.kss\bookmarks.html" maga pass
File "BookmarksToDelicious.py", line 77
isoTime = strftime("%Y-%m-%dT%H:%M:%SZ", gmtime (int(item.getTime())))
^
IndentationError: expected an indented block

Posted by: Marcus on November 10, 2004 8:02 AM | permalink

Hey Marcus.

Probably the simplest, easiest thing for you to do is to just change the line from:

isoTime = strftime("%Y-%m-%dT%H:%M:%SZ", gmtime (int(item.getTime())))

to:

isoTime = ""

and keep the indentation the same.

This means that your imported bookmarks won't have the proper date stamped on them, but that's probably acceptable. If it isn't, I'll contact the original writer with my patch.

Posted by: Joe Grossberg on November 10, 2004 11:12 AM | permalink

No more comments! Either someone has violated Godwin's Law, I'm tired of the discussion or, most likely, the ten-week window has closed. You can, however, contact me through email.