Monday, May 07, 2007

Howto: import your content to alexandria

So I have a problem right? Alexandria is a nifty little application for listing the books you have as a digital library. Allconsuming used to fill that niche, and I've invested a lot of time into it.

So, this should be easy, right? Web 2.0 should mean webservices are exploding out of every possible port... right?

Not so! The information that is there isn't very useful - not even the RSS feeds really allow you to get structured data out.

But there is a way, be it quick and dirty.

First, check you've got Alexandria

sudo -s apt-get install alexandria

Next, go to your Allconsuming javascript setup page. Make sure you've logged in.

You see the script tag mentioned there? Grab it, and change it.

My original one was:

and I now change it to:

Next, I visit the url in my browser, firefox.

I choose to save the page somewhere - call it `export`. We don't care about this page, really, but about the images attached. All of these images (in a handy fashion) are stored as an ASIN, and a file extension. An ASIN is an amazon product code, which handily defaults to an ISBN for books.

Firefox will put this saved page somewhere, like ~/, so whip open a terminal.

cd ~/export_files/
ls > export.txt

Open export.txt in gedit or similar, and replace all of the '.jpg' with '', then save.

Finally, open up Alexandria, and choose 'import'. Select a type of 'isbn list', and navigate to ~/export_files/export.txt

Done! You'll get a few importing errors, no doubt, and Alexandria isn't the best to give you informative errors... but you've just got your library into your library manager.

No comments: