I use Foxmarks to keep different computers' bookmarks sync'ed to each other. I have one set of bookmarks for use on home computers, and another set for use at work computers. (I also use delicious for low usage bookmarks I know I want available everywhere.)

With Foxmarks, you can sync your bookmarks to their servers, or you can sync to your own webdav server. I prefer to host my own stuff, so I sync to my own webdav server. The bookmarks are stored in JavaScript's json file format.

But, that doesn't give me the option to browse to the server and easily see the other set of bookmarks. (If I sync'ed to Foxmarks' servers, then I could see them at my.foxmarks.com if I login with my other username.)

What's a Pythonista to do? Write a script that displays the bookmarks as URLs on a webpage! Sweet! Now I host my own repository for my bookmarks, and they're available online in case I need to see the other set's bookmarks. Here's the script:

Tags:

Comments

Hi,This is exactly what I was looking for!I wonder whether it is possible to have a modified version of the script which accesses the foxmarks.json file from the same directory where the script is, without going through http. In this way I don't need to have my password stored in clear in a DAV server. My proficiency in Python is zero...cheers--e.

Thanks for the quick response.However, I meant something else :-)I am going to have both the foxmarks.json file and the python script in the same directory in a protected dav accessible directory handled by a web server, say "https://myserver/dav/foxmarks/". I'd like to invoke the python script from a browser as "https://myserver/dav/foxmarks/index.py" and I'd like to see the outcome as a web page. So far, so good - your script is meant to do exactly this. However, I don't really like the idea that within the script my password is written in clear in a DMZ server (actually it is explicitly forbidden by our rules). I guess that the script could access the foxmarks.json file directly as a file, instead to go through the URL "https://user:pass@myserver/dav/foxmarks/foxmarks.json". I tried to use "file://foxmarks.json" but it didn't work. Any suggestion on how to do this?cheers--e.

I have in vain tried to the index.py script. I run FC9 and did install the simplejson module. Still I get only the code of the py script echoed to the script. I am not conversant with python, but something tells me this must be something simple. As usual, any help is most appreciated.