Help! I want to create a PHP script that returns just the cleaned-up html output of the story. How do I go about doing that?
For example:
URL
Quote:
http://localhost/getstory.php?source=ffnet&storyid=1234567
|
I assume I'll have to create a getstory.php based on a modified fflag? Not exactly sure how I go about modifying fflag, though. Also, some modules (e.g. ffnet.source.php) display status messages. I assume I just need to comment out all
printMsg lines from those modules?
EDIT:
Nevermind, got it working. Just had to edit two sections in the main fflag program. Didn't even need to touch any of the other modules. Additions in green, deletions in red.
Code:
//Config
require_once('inc/args.inc.php');
//$config = getCliArgs();
$config['source'] = $_GET['source'];
$config['format'] = 'html';
$config['storyid'] = $_GET['storyid'];
//Output the compiled file if it the story is valid
if ($story['meta']['title'] != "") {
//Output file
echo $output;
/*
//Create the file name
if (!isset($config['outfile']) || $config['outfile'] == '-') $config['outfile'] = getBaseFilename($story) . ".{$config['format']}";
//Output the file
printMsg("\t* Writing output to {$config['outfile']}...\n");
file_put_contents($config['outfile'], $output);
*/
Oh yeah, just had a root canal so I had a bit of free time today. Just putting the finishing touches on a SugarQuill source.php and it'll be ready for posting.
Alas, porting the ffnet source to a Calibre/Python recipe is taking much longer. I have a working recipe used in conjuction with a local Apache+PHP server (that's the reason why I needed variable passing via URL) but converting the chapter retrieval and page cleaning logic to Python escapes me.