unhinged

Hello there, not sure whether this will be of interest to anyone but I knocked this together to get my del.icio.us bookmarks into the Brain. I've only tested it with version 5. It'll create output in Brain XML format which you can then import into PB.

Edit: I should say that it groups your bookmarks under parent tag nodes, it doesn't just import them all under one node. It also creates the tags.

Quote
russnh

Sounds like a great idea, but maybe I'm being a little thick here - how do you get this script to work please?!

Thanks,

Russ

Quote
unhinged
You're not being stupid, I've just been presumptuous.

The script's written in Python so you'll need that installed for it to work. I'm not a windows user but I might be able to make it a windows executable. To use it, you need to export your bookmarks to a file, it's in the settings section of delicious. Then run:

python delicious2brain.py file:///bookmarks.htm > brain.xml

You can then import the XML file into a Brain. This is what I'd do on a unix machine, I'll see about making an exe for windows, sorry.
Quote
russnh
Thanks, that's very useful. After I'd posted the message I looked at your file and realised what was required (I should have done that first, doh!) I'll have a go at it on my Linux box. Thanks for a useful utility.

Russ


Quote
kolius
thank you very very much! It worked for me!
Quote
zoner
I actually got around to trying out my own suggestion on importing my delicious bookmarks into my Brain and it worked. Just wanted to make a mention of it on this thread since it's another alternative for importing if you do not have python installed. I tried out your script and it works great, thanks. I used Python for Windows since I don't have a Linux box handy at the time.



Quote
cd

Hi all,

unhinged: many thanks!

i was wondering about the guids for some "thought-injection" - i'm thinking about (mail|sms)2pb) - but w/o having looked at their structure in detail (just extracting so far) i had not seen the similarity to the uuid from rfc4122 and pb guids. Nice catch!

BTW: The DTD states that guids starting with '!' are considered temporary and will be turned into true guids upon import. If the imported parts don't get re-imported at a later date (by modifying the xml), this might be an option.

I have tested with bogus guids and even data like '!fantastic' will get turned into a proper guid upon import. However, as stated in the DTD, re-import of the same (modified) xml at a later date will not allow updates to the imported structures.

Thought this could come in handy.

Thanks for the code!

Cheers
Chris

--
PB 5.5.2
Java 1.6.0_14 w/ -Dawt.useSystemAAFontSettings=lcd -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dawt.toolkit=sun.awt.motif.MToolkit
Crunchbang Linux on an NC10
Quote
jostber
Wondering, what is the main advantage with using del.icio.us?



TheBrain 8.0.2.0 Slackware 14.1 KDE 4.10.3 Java 1.7.0_25 / (Windows 7)

Quote
unhinged
I used to use it as a place to store my bookmarks so that I could access them from anywhere. I now use chrome's synchronised bookmarks. Obviously the brain can be used for bookmarks but it's not my cup of tea as it requires a change of focus away from the browser.

The idea behind the application was so that I could move away from del.icio.us and over to the brain.
Quote
topps
unhinged wrote: Then run:

python delicious2brain.py file:///bookmarks.htm > brain.xml



Hmmm, did not work for me. I tried this under Mac OS, using the Terminal. Python is built into OS X. However I got the following error message when I tried to run this script.

topps$ python delicious2brain.py file:///delicious-20100226.htm > brain.xml
Traceback (most recent call last):
  File "delicious2brain.py", line 8, in <module>
    from BeautifulSoup import BeautifulSoup as BS
ImportError: No module named BeautifulSoup

So do I need this beautifulSoup module and if so where do i get it from?
Quote
topps
topps wrote: Then run:

python delicious2brain.py file:///bookmarks.htm > brain.xml



Hah, well that was not so hard. I found BeautifulSoup - first hit on Google search. And it was nice and easy to install the module into the Python library path, even though I am a complete newbie at this. Doing this on a Mac so had to pay attention to Python version (2.6.1) and BeautifulSoup version (3.0.8) but the setup.py pretty much automated things. Great.

Had to tweak the file:// path slightly and after that, it all went swimmingly. Imported 3367 nodes into a 1.8MB brain.xml file which then loaded smoothly into PBrain 5.5.2.2

Am a happy boy. This is a much better way to do things than the other method of importing via IE or Firefox bookmarks. The tags are preserved and nodes are grouped under tags, which for me makes them much more usable with a large number of delicious bookmarks.

Thanks very much.
Quote
topps
unhinged wrote:

Edit: I should say that it groups your bookmarks under parent tag nodes, it doesn't just import them all under one node. It also creates the tags.



One minor disappointment. Tags are imported nicely. But the notes field is not. I make short notes about many of my delicious tags. Any chance that this Python script could tackle this as well? Anybody want to tackle this minor challenge.

I might if I get brave but this would be my first foray into Python. All my previous stuff has been in VB and .Net so you see how challenged I am.
Quote
unhinged
Not made much of a change so it does nothing special with carriage returns and that sort of stuff (exercise for the reader) but notes added... maybe, not tested much.
Quote

Add a Website Forum to your website.

Newsletter Signup  Newsletter Signup        Visit TheBrain Blog   Visit TheBrain Blog       Follow us on Twitter   Follow Us       Like Us on Facebook   Like Us         Circle Us on Google+  Circle Us         Watch Us on Youtube  Watch Us       

TheBrain Mind Map & Mindmapping Software     Download TheBrain Mind Mapping Software