From 07ae53df607389357e04b4777333b6993093c530 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 12 Jul 2023 21:30:53 +0300 Subject: [PATCH] add crawl/clean commands to the CLI tool --- README.md | 2 ++ cli/yggo.php | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/README.md b/README.md index 082629c..51778e7 100644 --- a/README.md +++ b/README.md @@ -222,6 +222,8 @@ GET m=SphinxQL ##### CLI * [x] help +* [x] crawl +* [x] clean * [x] hostPageDom + [x] generate + [x] truncate diff --git a/cli/yggo.php b/cli/yggo.php index 6dbb58c..7c8b665 100644 --- a/cli/yggo.php +++ b/cli/yggo.php @@ -29,6 +29,16 @@ if (empty($argv[1])) $argv[1] = 'help'; switch ($argv[1]) { + case 'crawl': + + include_once(__DIR__ . '/../crontab/crawler.php'); + + break; + case 'clean': + + include_once(__DIR__ . '/../crontab/cleaner.php'); + + break; case 'hostPageDom': if (empty($argv[2])) { @@ -128,6 +138,8 @@ echo '/_/\____/\____/\____(_)' . PHP_EOL; echo PHP_EOL . _('available options:') . PHP_EOL . PHP_EOL; echo _(' help - this message') . PHP_EOL; +echo _(' crawl - execute crawler step in the crontab queue') . PHP_EOL; +echo _(' clean - execute cleaner step in the crontab queue') . PHP_EOL; echo _(' hostPageDom generate [selectors] - make hostPageDom index based on related hostPage.data field') . PHP_EOL; echo _(' hostPageDom truncate - flush hostPageDom table') . PHP_EOL . PHP_EOL;