In the circle, there was again interest in a small script, which of course is to automate tedious work again. I found the task not just uninteresting, so I've just set it. This time, however, no Python code, no, Perl. (Lately, I've learned also know its advantages.)
The Perl script is in the position of the side studentconsult.de books download. As far as I know, you can purchase on this site probably for the study of great books and read them online. Prima. Is just a little silly if you even read these things offline will. That is not possible, unless you save the pages by hand. Well, no satisfactory solution.
I say it before: The script is nothing more than a quick hack. It works, at least the way I've tested it. There could be many opportunities for improvement and the source code to make even more beautiful. It runs as usual: the project is free software, anyone can help yourself. If someone reports, I would be more willing to make changes.
First, install the Perl and curl. Perl should belong to the default, rather not curl.
sudo apt-get install perl curl.
get now fix the script and make it executable.
curl-O 'http://dl.dropbox.com/u/1996083/Projects/studentconsult-downloader/studentconsult-downloader.pl chmod + X StudentConsult-downloader.pl
The script requires a few more information. You have to open the browser, logs in and opens the book, which you want to download. In the address bar you will find a now a parameter, which looks like an ISBN number (and probably also is). This number is required (and with the hyphens!). You'll also need the cookies. In Firefox, go over the Edit> Preferences> Privacy> Show Cookies (is on several different versions of Firefox). There, one looks for studentconsult.de and investigated the cookies CFID and CFTOKEN (See picture).
![](http://3.bp.blogspot.com/_-C3w1uboIpk/TOGj9cs63YI/AAAAAAAABTw/F4uSGD-rJH4/s200/cookies.png)
Now you have to edit the script and find the first section 3 lines that start with our :
our $ cookie_cfid = '' ; our $ cookie_cftoken = '' ; our $ isbn = '' ;
In this Variable definitions with one of the above values in the single quotes one. That's it. Start the script simply by running:.
/ student consult downloader.pl
The venture now takes quite a while. If we again face a command prompt to get the script and issued no messages, then it is ready. The self-generated summary page can be found at / tmp / student consult / index.html .
Before running the script a second time (eg with a different book-ISBN), then delete the folder you previously / tmp / student consult / !
Perhaps the script benefits someone. In such a case, I'd appreciate a little feedback. Those who have suggestions should make themselves known, as always you. You can still do many things, such as the sides could be styled with CSS. In addition, the frames not to be chic and images are not yet processed. (One can but also look at just the page source from the online portal ... The original code is also less not as standards-compliant,) I am surprised that a browser is so smart at all to get it baked a displayable page ... )
Enjoy.
![](http://3.bp.blogspot.com/_-C3w1uboIpk/TOGmuYpWsLI/AAAAAAAABT4/DpfTiWxczVc/s320/output.png)
- project homepage
- download directory
0 comments:
Post a Comment