Move files to logical positions, no more copying of files.

This commit is contained in:
DariusIII
2015-05-27 00:39:04 +02:00
parent f6632f2679
commit ffa9797126
1472 changed files with 27 additions and 41 deletions
@@ -0,0 +1,35 @@
<?php
require_once(dirname(__FILE__) . "/../../bin/config.php");
if (!is_file(NN_TMUX . 'lib' . DS . 'IRCScraper' .DS . 'settings.php')) {
exit('Copy settings_example.php to settings.php and change the settings.' . PHP_EOL);
}
if (!isset($argv[1]) || $argv[1] !== 'true') {
exit(
'Argument 1: false|true ; false prints this help screen, true runs the scraper.' . PHP_EOL .
'Argument 2: (optional) false|true ; true runs in silent mode (no text output)' . PHP_EOL .
'Argument 3: (optional) false|true ; true turns on debug (shows sent/received messages from the socket)' . PHP_EOL .
'examples:' . PHP_EOL .
'php ' . $argv[0] . ' true ; Scrapes PRE with text output.' . PHP_EOL .
'php ' . $argv[0] . ' true true > /dev/null 2>&1 ; (unix) Scrapes PRE with no text output, in the background (you can close your terminal window).' . PHP_EOL .
'php ' . $argv[0] . ' true false true ; Scrapes PRE with text output and debug output.' . PHP_EOL .
'php ' . $argv[0] . ' true true true ; Scrapes PRE with debug but no text output.' . PHP_EOL
);
}
require_once (NN_TMUX . 'lib' . DS . 'IRCScraper' .DS . 'settings.php');
if (!defined('SCRAPE_IRC_NICKNAME')) {
exit('ERROR! You must update settings.php using settings_example.php.');
}
if (SCRAPE_IRC_NICKNAME == '') {
exit("ERROR! You must put a username in settings.php" . PHP_EOL);
}
$silent = ((isset($argv[2]) && $argv[2] === 'true') ? true : false);
$debug = ((isset($argv[3]) && $argv[3] === 'true') ? true : false);
// Start scraping.
new IRCScraper($silent, $debug);