summaryrefslogtreecommitdiffstats
path: root/lib/Command
diff options
context:
space:
mode:
authorDriverXX <DriverXX@users.noreply.github.com>2019-12-24 09:33:19 +0100
committerBenjamin Brahmer <info@b-brahmer.de>2019-12-24 09:33:19 +0100
commit6673cbc3d940745a0ecddb93b32805a0fbe79eb1 (patch)
tree72d50a36c4635311a684375106652d88d019575e /lib/Command
parentc2f617dd400681b67927781a73a735600803d9ae (diff)
Reimplement full-text scraping (#563)
Add readability.php scraper Fixes #482 Signed-off-by: Gioele Falcetti <thegio.f@gmail.com>
Diffstat (limited to 'lib/Command')
-rw-r--r--lib/Command/ShowFeed.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Command/ShowFeed.php b/lib/Command/ShowFeed.php
index bbe1913fa..572b68e26 100644
--- a/lib/Command/ShowFeed.php
+++ b/lib/Command/ShowFeed.php
@@ -48,7 +48,8 @@ class ShowFeed extends Command
->setDescription('Prints a JSON string which represents the given feed as it would be in the DB.')
->addArgument('feed', InputArgument::REQUIRED, 'Feed to parse')
->addOption('user', 'u', InputOption::VALUE_OPTIONAL, 'Username for the feed')
- ->addOption('password', 'p', InputOption::VALUE_OPTIONAL, 'Password for the feed');
+ ->addOption('password', 'p', InputOption::VALUE_OPTIONAL, 'Password for the feed')
+ ->addOption('full-text', 'f', InputOption::VALUE_NONE, 'Usa a scraper to get full text');
}
protected function execute(InputInterface $input, OutputInterface $output)
@@ -56,9 +57,10 @@ class ShowFeed extends Command
$url = $input->getArgument('feed');
$user = $input->getOption('user');
$password = $input->getOption('password');
+ $fullTextEnabled = (bool) $input->getOption('full-text');
try {
- list($feed, $items) = $this->feedFetcher->fetch($url, true, null, $user, $password);
+ list($feed, $items) = $this->feedFetcher->fetch($url, true, null, $fullTextEnabled, $user, $password);
$output->writeln("Feed: " . json_encode($feed, JSON_PRETTY_PRINT));
$output->writeln("Items: " . json_encode($items, JSON_PRETTY_PRINT));
} catch (\Throwable $ex) {