Move IRCScraoer into misc/testing folder

This commit is contained in:
Darko
2015-07-31 12:26:32 +02:00
parent 9f0b3036c9
commit fa5b06eb2e
7 changed files with 3 additions and 3 deletions
@@ -1 +0,0 @@
/settings.php
@@ -1,9 +0,0 @@
These scripts run IRC bots to get PRE information.
You must first copy settings_example.php to settings.php and change the settings in the file (settings.php).
Next you can run scrape.php, it will tell you all the options.
scrape.sh runs the bots with text output, if you cancel the script, one of the bots will still run, you must kill it manually.
scrape_daemon.sh runs the bots with no text output and lets go of the terminal lock (if you want to restart the script later, you MUST kill the bots first).
@@ -1,35 +0,0 @@
<?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);
@@ -1,20 +0,0 @@
#!/bin/bash
cmd1="/usr/bin/php scrape.php corrupt";
cmd2="/usr/bin/php scrape.php efnet";
# Kill corrupt if it's already open.
`ps -ef | grep "php corrupt" | awk '{print $2}' | xargs kill`
sleep 2
# Run corrupt in the background.
$cmd1 &
sleep 3
echo ""
echo "This started scrapeCorrupt in the background, if you cancel this script, it will still run, so you must kill it manually."
echo "scrapeEfnet, will close however, since it was not started in the background."
echo ""
echo `ps aux | grep 'php corrupt' | awk '{print $2}'`
echo "To kill it, in the message above, you see a number, in a command line, type kill theNumber (theNumber, is the number over this line, the one to the left)"
echo ""
sleep 3
$cmd2
@@ -1,21 +0,0 @@
#!/bin/bash
# This runs IRCScraper silently in the background.
cmd1="/usr/bin/php scrape.php corrupt true";
cmd2="/usr/bin/php scrape.php efnet true";
echo "Started IRCScraping in daemon mode."
# Kill corrupt if it's already open.
`ps -ef | grep "php corrupt" | awk '{print $2}' | xargs kill`
sleep 2
# Kill efnet if it's already open.
`ps -ef | grep "php efnet" | awk '{print $2}' | xargs kill`
sleep 2
# Run corrupt
$cmd1 &
sleep 3
# Run efnet
$cmd2 &
@@ -1,51 +0,0 @@
<?php
// If lazy set all usernames/nicknames/names here.
// MAKE SURE THIS IS UNIQUE, IF SOMEONE HAS THE USERNAME ALREADY YOU WILL GET A BUNCH OF ERRORS, YOU HAVE BEEN WARNED.
$username = '';
// https://www.synirc.net/servers Try another server if you have issues.
define('SCRAPE_IRC_SERVER', 'irc.synirc.net');
// Use Port 6697 or 7001 and set SCRAPE_IRC_TLS to true for encryption.
define('SCRAPE_IRC_PORT', '6667');
define('SCRAPE_IRC_TLS', false);
define('SCRAPE_IRC_NICKNAME', "$username");
define('SCRAPE_IRC_REALNAME', "$username");
define('SCRAPE_IRC_USERNAME', "$username");
// Set to false if you need no password. Use a string (quoted text) if you need a password.
define('SCRAPE_IRC_PASSWORD', false);
// Regex to ignore categories. Leave empty ('') to not exclude any category.
// Case sensitive example: '/^(XXX|PDA|EBOOK|MP3)$/'
// Case insensitive (note the i): '/^(X264|TV)$/i'
define('SCRAPE_IRC_CATEGORY_IGNORE', '');
// Set to true to ignore a source.
define('SCRAPE_IRC_SOURCE_IGNORE',
serialize(
array(
'#a.b.cd.image' => false,
'#a.b.console.ps3' => false,
'#a.b.dvd' => false,
'#a.b.erotica' => false,
'#a.b.flac' => false,
'#a.b.foreign' => false,
'#a.b.games.nintendods' => false,
'#a.b.inner-sanctum' => false,
'#a.b.moovee' => false,
'#a.b.movies.divx' => false,
'#a.b.sony.psp' => false,
'#a.b.sounds.mp3.complete_cd' => false,
'#a.b.teevee' => false,
'#a.b.games.wii' => false,
'#a.b.warez' => false,
'#a.b.games.xbox360' => false,
'#pre@corrupt' => false,
'#scnzb' => false,
'#tvnzb' => false,
'omgwtfnzbs' => false,
'orlydb' => false,
'prelist' => false,
'srrdb' => false,
'u4all.eu' => false,
'zenet' => false
)
)
);