summaryrefslogtreecommitdiffstats
path: root/lib/Fetcher
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-01-04 11:10:19 +0100
committerBernhard Posselt <BernhardPosselt@users.noreply.github.com>2017-01-04 11:10:19 +0100
commitbc27596f70cb170203655a55c0f53ee55d8d6316 (patch)
tree2ae44ee8f5ff0e77f5f8ff0a886db905be55d081 /lib/Fetcher
parent04f66c9710faf9438adcc69028eed082c98a5178 (diff)
Add postprocessor for getting lwn subscriber articles (#72)
Diffstat (limited to 'lib/Fetcher')
-rw-r--r--lib/Fetcher/FeedFetcher.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Fetcher/FeedFetcher.php b/lib/Fetcher/FeedFetcher.php
index 194a927f9..587e64af2 100644
--- a/lib/Fetcher/FeedFetcher.php
+++ b/lib/Fetcher/FeedFetcher.php
@@ -15,6 +15,8 @@ namespace OCA\News\Fetcher;
use Exception;
+use OCA\News\PostProcessor\LWNProcessor;
+use OCP\Http\Client\IClientService;
use PicoFeed\Parser\MalFormedXmlException;
use PicoFeed\Reader\Reader;
use PicoFeed\Parser\Parser;
@@ -42,15 +44,18 @@ class FeedFetcher implements IFeedFetcher {
private $reader;
private $l10n;
private $time;
+ private $clientService;
public function __construct(Reader $reader,
PicoFeedFaviconFactory $faviconFactory,
IL10N $l10n,
- Time $time) {
+ Time $time,
+ IClientService $clientService) {
$this->faviconFactory = $faviconFactory;
$this->reader = $reader;
$this->time = $time;
$this->l10n = $l10n;
+ $this->clientService = $clientService;
}
@@ -108,6 +113,7 @@ class FeedFetcher implements IFeedFetcher {
if ($fullTextEnabled) {
$parser->enableContentGrabber();
+ $parser->getItemPostProcessor()->register(new LWNProcessor($basicAuthUser, $basicAuthPassword, $this->clientService));
}
$parsedFeed = $parser->execute();