Automating Bookshare

Tony Baechler tony at baechler.net
Sat Feb 23 04:09:30 EST 2008


Hi,

I'm surprised that no one has come up with a meaningful answer to this 
problem.  I can tell you right off what part of the problem is.  The 
cookie sent is a per-session cookie, meaning that it is not permanent 
and expires as soon as you close your browser.  So, wget is logging in 
the first time like you expect but then the cookie expires because wget 
closes the connection.  What you might do is look at curl which has more 
features in this department, but you're probably out of luck with a 
noninteractive file grabber.

What you need to do is somehow script a browser.  I haven't seriously 
studied this program, but edbrowse comes to mind.  It also supports 
Javascript which wget doesn't.  I have no idea how you would script it 
to do what you want, but the idea is that it's like the ed line editor 
so there should be a way to do what you want.  Other than that, you 
would have to get a keyboard macro package (is there such a thing for 
linux?) and set it up to log in with Lynx, tab to the submit button 
after entering email address and password, press the letter "g" to go to 
a url, enter the url of the newspaper you want and tell it to save to 
disk.  You could also bookmark the periodicals page, press the letter 
"v" to view bookmarks, go to the end, hit enter on the periodicals 
bookmark, search for "DAISY" and download that way.  The advantage is 
that you wouldn't have to calculate the correct url every time.  Then 
just set up something in your crontab to run the script every day and 
all should be well.  Note that all of this is theoretical and I haven't 
actually tried any of it.

I am just guessing but I think there is probably a way to automatically 
login which is undocumented.  K1000 also has this ability.  You might be 
violating the user agreement though since I don't think automated logins 
are allowed, but I don't see why it would be a problem.

Steve Holmes wrote:
> Yeah, it is the login sequence that isn't working for me.  My last
> attempt to login with a script used two itterations of wget and I
> specified the wget command with the post variables for email and
> password but I didn't get any real meaningful feedback to tell me if
> the login was successful or not.  the second pass worked in the sense
> that it requested the desired file but then I got back the error page
> telling me that I was never logged in.
>
> My ultimate goal was to have a script pull my daily newspaper from
> bookshare and dump the thing onto an SD card so I could come up to my
> computer in the morning and grab the card and pop it into my Victor
> Reader Stream and groove on the day's news.:)  I heard people doing
> that with the Icon small computer so figured there could be a way for
> us to do it with shell script or something similar and yield the same
> results.  In any case, it would be a fun project if I could get it to
> work.
>   





More information about the Speakup mailing list