summaryrefslogtreecommitdiff
path: root/config/services/web/rss/DeutschLernenDeutscheWelleBridge.php
diff options
context:
space:
mode:
authorquentin@aristote.fr <quentin@aristote.fr>2026-11-29 17:24:18 +0100
committerquentin@aristote.fr <quentin@aristote.fr>2026-11-29 17:42:35 +0100
commitce831333a24011d0692f6871047fe74eab9fab8c (patch)
tree9bb971e2afe0a4b22c73274e8b8e8d05d014401d /config/services/web/rss/DeutschLernenDeutscheWelleBridge.php
downloadhermaphroditos-ce831333a24011d0692f6871047fe74eab9fab8c.tar.gz
hermaphroditos-ce831333a24011d0692f6871047fe74eab9fab8c.tar.bz2
hermaphroditos-ce831333a24011d0692f6871047fe74eab9fab8c.tar.xz
initial commit
Diffstat (limited to 'config/services/web/rss/DeutschLernenDeutscheWelleBridge.php')
-rw-r--r--config/services/web/rss/DeutschLernenDeutscheWelleBridge.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/config/services/web/rss/DeutschLernenDeutscheWelleBridge.php b/config/services/web/rss/DeutschLernenDeutscheWelleBridge.php
new file mode 100644
index 0000000..710f8e6
--- /dev/null
+++ b/config/services/web/rss/DeutschLernenDeutscheWelleBridge.php
@@ -0,0 +1,39 @@
+<?php
+
+class DeutschLernenDeutscheWelleBridge extends XPathAbstract {
+ const NAME = 'Deutsche Welle Lernen Bridge';
+ const URI = 'https://learngerman.dw.com/de/';
+ const DESCRIPTION = 'Cost-free German-learning material';
+ const MAINTAINER = 'Quentin Aristote';
+ const CACHE_TIMEOUT = 3600; // 24h
+
+ const PARAMETERS = [
+ '' => [
+ 'id' => [
+ 'name' => 'Identifier',
+ 'type' => 'text',
+ 'description' => 'An identifier of the shape [a-z]-[0-9]*. Found at the end of the target URL.',
+ 'exampleValue' => 's-60040484'
+ ]
+ ]
+ ];
+
+ const XPATH_EXPRESSION_ITEM = '//div[@class="teaser-wrap"]/a';
+ const XPATH_EXPRESSION_ITEM_TITLE = './@title';
+ const XPATH_EXPRESSION_ITEM_URI = './@href';
+ // not given
+ // const XPATH_EXPRESSION_ITEM_AUTHOR =
+ const XPATH_EXPRESSION_ITEM_TIMESTAMP = './/time/@datetime';
+ // requires javascript
+ // const XPATH_EXPRESSION_ITEM_ENCLOSURES = './figure/img[2]/@src';
+ const XPATH_EXPRESSION_ITEM_CATEGORIES = './div[2]/span[1]/text()';
+
+
+ public function getIcon() {
+ return 'https://learngerman.dw.com/favicon.png';
+ }
+
+ public function getSourceUrl() {
+ return self::URI . $this->getInput('id');
+ }
+}