Jump to content

Off-line reading on PDAs, phones, etc.


Tristan Thinks

Recommended Posts

As an author and reader I only discovered gayauthors relatively recently through a recommendation from another author and email buddy.

 

I've had the chance to read the complete works of several authors so far, amongst them Dan HanRatty, DomLuka, Viv, and Vlista. Mostly I read stories off-line on a PDA or 'phone using the web browser. It means I can read comfortably at bedtime, whilst travelling, or in the comfort of the sofa or armchair.

 

I orginally started reading on nifty, and there it was a simple process to download the story index and chapters and read them offline because they are published mostly as text/plain or text/html (with .html extension) documents.

 

However, here on gayauthors all the authors sites, indexes, and chapters are PHP scripts (.php) so when downloaded for off-line reading most browsers don't know to render them as text/html without tweaking mime-type associations.

 

I'm not sure what the reason for using PHP is, unless for some kind of reader-count, although that could be achieved from the web-server logs.

 

Anyhow, I threw together a small script that lets me download and convert any gayauthor sub-site for off-line reading. It converts spaces in filenames to hyphens and .php extensions to .html, ensuring that internal links are converted too so following links still works. I named the script php2html

 

#!/bin/sh
  # php2html
  # Modify .php e-books to work offline as .html
  # modifies file extensions and internal links from .php to .html
  # fixes up spaces in filenames to hyphens, and internal links to those files

  wget -r -nH -U "Firefox" -L "$1"
  find . -exec rename 's/ /-/g' "{}" \;
  find . -name '*.php' -exec rename 's/\.php$/.html/' "{}" \;
  find . -name '*.html' -exec sed -i 's/\.php/.html/g' {} \;
  find . -name '*.html' -exec sed -i -e 's/\(href=".*\) \(.*\.html"\)/\1-\2/g' -e 's/\(href=".*\)%20\(.*\.html"\)/\1-\2/g' {} \;

 

Set-up as an executable script:

 chmod +x php2html

 

To grab an author's stories I do something like:

mkdir vlista
cd vlista
php2html http://vlista.gayauthors.org/stories.html

which would download all Vlista's stories, converting the indexes and chapter files to work off-line.

 

Then, I copy the entire directory and sub-directories onto the PDA or 'phone (or memory card) and can read at my convenience.

 

Of course, this script will only work on GNU/Linux although if you have Cygwin on Windows it will also work. I suspect it'll work on Mac OSX also with maybe minor fixups for the BSD-ness :) Obviously it'll also work in a GNU/Linux virtual machine on Windows, Mac, or other VM-supporting operating system.

 

It would be cool if each authors site provided a ZIP download archive of an off-line readable version of their stories that uses .html file extension to extend the value of gayauthors to mobile off-line readers. The web sever could auto-create it using my script here to process the on-line files and then adding them to a ZIP and adding the download link(s) into the index files.

Link to comment
Share on other sites

First off, Welcome to GA... :)

 

I would say that this is a really great idea. I too use my cell phone to read stories but I never encountered such a problem as I use GPRS and Opera Browser on my phone.

 

I know E-Fiction provides for .doc files to be downloaded, but the hosted authors' sites do not have that facility. Nice suggestion, though.

 

:)

 

BeaStKid :devil:

Link to comment
Share on other sites

First off, Welcome to GA... :)

 

I would say that this is a really great idea. I too use my cell phone to read stories but I never encountered such a problem as I use GPRS and Opera Browser on my phone.

 

I know E-Fiction provides for .doc files to be downloaded, but the hosted authors' sites do not have that facility. Nice suggestion, though.

 

:)

 

BeaStKid :devil:

I had no idea you could download E-Fiction like that. That sounds quite handy. How do I do that?

Link to comment
Share on other sites

I had no idea you could download E-Fiction like that. That sounds quite handy. How do I do that?

Hmmm...apparantly, that feature has been discontinued. A new feature has come out in its place.

 

When you click on a story, you get to see its first chapter. There is a link to the reviews on the top of the page just below the story's name. The third link on that (besides the printer) used to be a big W (MS Word symbol) that used to let us download Word documents of the story.

 

This has been replaced by .php documents.... :thumbdown:

Link to comment
Share on other sites

  • Site Administrator

For the record, we use php mostly to insert menus and common things. For example, on a story, there are links to all the chapters and the main index of that story for many of our authors. with php, we update those links once, and it appears on all chapters.

The end result to the user (you) is an html file that already has all the stuff because the server puts that information in when you go to view it.

 

We will not be offering that option in the near term. We may consider it as part of a premium service for Gay Authors. (it costs us a non-inconsiderable amount of money each month to keep Gay Authors open for everyone)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Our Privacy Policy can be found here: Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..