Scripting

Migrate From Scrap Book To Zotero

Migrate From Scrapbook To Zotero

This is an adaptation of dmercier's thread at: http://forums.zotero.org/discussion/145/import-from-scrapbook

I wanted to have the page content available in zotero as well as just the urls so I could index and search it (as well as have access to sites no longer there). Attaching scrapbook's index.html gave searchable content, but missed out pictures so I converted the pages to pdf then imported them. I used wkhtmltopdf to do the conversion as I'm on linux, but I'm sure there are similar things out there for windows/mac.

Steps:

Step 1 : install wkhtmltopdf

Step 2 : run through each index.html and convert:

scrapbook_folder=~/Dropbox/scrapbook/data/
for scrap_file in $(find $scrapbook_folder -name index.html)
do
echo $scrap_file
wkhtmltopdf "$scrap_file" "${scrap_file}.pdf"
done

copy the above into a file, alter the scrapbook_folder line to match where you have your scrapbook data. save the file to something like 'makepdfs' then run with:

sh makepdfs

This may take a while if you have a large collection.

Step 3 : modify COPY PAGE INFO configuration In Scrapbook Sidebar : Tools / Additional Features / Copy Page Info : Configuration.

Copy the text below :

TY - ELEC
T1 - %TITLE%
UR - %SOURCE%
L1 - %LOCAL%
L1 - %LOCAL%.pdf
N1 - SCRAPBOOK: %LOCAL%
PY - %DATE%
KW - %FOLDER%
ER - End of Reference

IMPORTANT : two spaces between the tag and the dash (« - ») and only one space after the dash. For example TY+space+space+dash+space+ELEC. Also make sure you leave a line after the ER line otherwise the import won't work!

(You can leave out the line "L1 - " if you wish. I like this as it gives you a html version of the page. It misses the pictures and styles but allows for a quick and easy view of the page without having to open the PDF)

Step 4 : generate and copy in ClipBoard? a RIS formatted data In Scrapbook Sidebar : Tools / Additional Features / Copy Page Info : Tree

Step 5 : import RIS data into ZOTERO In Zotero pane : Actions / Import from clipboard

Step 6 : Once you have done the import, I had to go into the zotero preferences > search and run the reindex for them to be searchable.

Enjoy!