View Single Post
Old 10-01-2010, 05:16 PM   #211
aleyx
Addict
aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.aleyx can self-interpret dreams as they happen.
 
Posts: 250
Karma: 20386
Join Date: Sep 2010
Location: France
Device: Bookeen Diva, Kobo Clara BW
Quote:
Originally Posted by AtomicDryad View Post
This will only work for .html files written with r29mod2, which include a 'TotalPages' meta tag.
I'm note sure about <meta> tags. We can as easily (well, using XPath) count the number of <h3> elements, or more ideally, <h3 class="chapter_title">. As for the story ID, it's actually a useful info, which should be added to the 'front page'. Maybe between the summary and the dates, something like:
PHP Code:
<p>{$source->namestory <a id="story_id" href="{$story->url}">{$story->id}</a></p
This would allow us to easily retrieve the story ID, and give the reader the ability to directly go to the original.

Actually, id'ing the other meta fields would be a good idea. It would also allow the import of an .html, then convert to another format without having to reparse the story on the source site.

Quote:
Originally Posted by AtomicDryad View Post
The story summary is now included at the top of the output file, under title and author.
You should enclose it with a <p>, and use <em> instead of <i> (deprecated). The dates, as well (<p> instead of <br/>).
Quote:
Originally Posted by AtomicDryad View Post
Now searches for the story text via XPath, which should be more reliable. Requires php with dom and simplexml, change USEDOM=>1 to USEDOM=>0 if you get a php error.
I don't know... I think the 'dual mode' adds unneeded complexity. Users of FLAG most likely installed their own PHP stack, and so can install the needed extensions if they're not already bundled. A simple error message with the name of the missing dependencies, as with the codecs, should suffice here.

Quote:
Originally Posted by AtomicDryad View Post
Debug option for coders: -D will output debug text, and write all web GETS to debug-hostname-filename. If debug-hostname-filename exists, it will load that, instead of downloading. Good if you need to test without hammering fanfiction.net's server.
That's good indeed. We'll have to start thinking about a more robust logging facility though; we're having a lot of different functions logging in a lot of places, centralizing them would be good. Too bad PHP doesn't have something like Python's logging module...

Quote:
Originally Posted by AtomicDryad View Post
Alot of configuration options stored in $CONFIG hasharray at the top of the 'fflag' file, runtime options in $opt hasharray.
There's a good settings class here: http://www.php.net/manual/en/functio...file.php#92085

That would allow the configuration options to be removed from the code and put in a .conf.
aleyx is offline   Reply With Quote