Update to update: fixed a regex breaking -U, fixed output display
Update: r29mod2
Warning: After one too many flooded ssh sessions I've changed the -o option to match the unix non-standard: -o - outputs to screen, no -o will automatically name. Will make this optional later.
New option: -U, --update: If the output file already exists and has the same amount of chapters as the copy on fanfiction, fflag won't overwrite or download any extra chapters. This will only work for .html files written with r29mod2, which include a 'TotalPages' meta tag.
fflag now takes filenames as arguments. If the file is an .html written with this version or above, fflag will find the ID via a 'StoryId' meta tag. One can batch update a story collection with: fflag -U /home/user/myfanfics/*.html, which will produce less traffic than redoing the entire collection.
The story summary is now included at the top of the output file, under title and author.
The output display shows current/total stories while processing, also current/total chapters.
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.
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.
Alot of configuration options stored in $CONFIG hasharray at the top of the 'fflag' file, runtime options in $opt hasharray.
TODO:
Feature freeze until merge with erayd's branch.
Abstracted version of ffnet.source.php, that can be told to use config hash array which includes url specs, xpaths, regexps strings, etc.
Last edited by AtomicDryad; 10-01-2010 at 06:48 AM.
|