Quote:
Originally Posted by aleyx
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">.
|
You make a good point, though something can be said for the meta tag; one only need load the first 1024 bytes of a file. That would only matter for updates on -big- collections though.
Quote:
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.
|
For now ff.net seems to have a nice list of js variables that I've been plundering, instead of parsing the HTML directly. If this is to work on multiple sites it might be best to standardize the meta fields for fflag, not the site(s).
Quote:
You should enclose it with a <p>, and use <em> instead of <i> (deprecated). The dates, as well (<p> instead of <br/>).
|
I've already changed it to a <div> since I last updated. That seems more flexible.
Quote:
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.
|
The added complexity adds a single boolean check at runtime. The regexp itself is rather simple thing that might serve use as a fallback instead. I'd really like to make sure site parsing is either really robust or easy to adjust, for the inevitable breakage caused by bored fanfiction.net webmasters.
Quote:
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...
|
perhaps:
log($level,$str): level would be an int with 0=normal output 1=warn 2=error 3=debugging. This could be configured via
$CONFIG['loglevel']=array(0=>'php://stderr',1=>array('php://stderr','/var/log/whatever'),2=>'/var/log/whatever',3=>NULL); (syntax error in that, likely).
--loglevel 3 on commandline would add php://stderr to everything. One could also add functionality to adjust the level per namespace but that's probably going overboard.