Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

ISBN & Emacs through google books

by epimenidecretese (Acolyte)
on Oct 18, 2011 at 19:30 UTC ( #932222=perlquestion: print w/replies, xml ) Need Help??

epimenidecretese has asked for the wisdom of the Perl Monks concerning the following question:

Hello everyone,

I've started doing some research and I'm developing a little system to search/store/manage the books I've read or that I need. I always work with emacs-org-mode and I've built a pretty simple table that does the work(ISBN;Title,Author;State;pages;)

By working with curls,grep and awk I've been able to search any book by isbn,with this,highly inefficient little bash script:

#get the Book page by isbn with curl curl -s -A Mozilla http://books.google.com/books?vid=ISBN$1|grep -o Bi +bliographic\ information.*EndNote > /home/ninonino/.org/books/book_tm +p.html && #wait sleep 1 && #do some inefficient cleaning awk -F'>' '{for(i=1;i<=NF;i++) printf "%s>\n", $i}' /home/ninonino/.or +g/books/book_tmp.html > /home/ninonino/.org/books/clean.html && #parse the page,searching for the relevant data grep -A 1 'ltr' /home/ninonino/.org/books/clean.html|grep -o .*\<\/ > +/home/ninonino/.org/books/info.txt && #wait sleep 1 && #clean up the files used as temp(I said,it's inefficient) rm /home/ninonino/.org/books/clean.html /home/ninonino/.org/books/book +_tmp.html && #some more cleaning awk -F'</' '{for(i=1;i<=NF;i++) printf "%s\n", $i}' /home/ninonino/.or +g/books/info.txt > /home/ninonino/.org/books/book.txt && rm /home/ninonino/.org/books/info.txt

You can launch it passing the isbn as a parameter.

What I was wandering is if there is a way to do this with perl in a way that I could chose to search also by title(using google static links to google book research) without using the complex emacs macro that now I'm using.

I don't think the ISBN module would to the thing,a part that it doesn't work with the good google books,which I really like.

I'm not looking for the ready solutions,just some ways to follow(like xml? yes or no ? ;curl alternatives ? )

Then,the one thing that I can't(even inefficiently) do right now is to get the bibtex file citation from google(since there is a little php code which blocks wget/curl).But at this point I may consider creating the bibtex key from that data that I can parse from the page

(I would like to have the org-table in emacs with less information,and then a bibtex file with all the books).

Hope some one may point me out something interesting.I think this might take to a good little project really useful for academic research.

One of Crete's own prophets has said it: 'Cretans are always liars, evil brutes, lazy gluttons'.
He has surely told the truth.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://932222]
Approved by rovf
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2019-11-11 22:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (63 votes). Check out past polls.

    Notices?