diff options
Diffstat (limited to 'config')
| -rw-r--r-- | config/services/web/rss/DeutschLernenDeutscheWelleBridge.php | 39 | ||||
| -rw-r--r-- | config/services/web/rss/default.nix | 4 |
2 files changed, 43 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..6d12d25 --- /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 = 86400; // 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'); + } +} diff --git a/config/services/web/rss/default.nix b/config/services/web/rss/default.nix index bb9d6ca..8884aee 100644 --- a/config/services/web/rss/default.nix +++ b/config/services/web/rss/default.nix @@ -15,6 +15,10 @@ in name = "Randonavigo"; source = ./RandonavigoBridge.php; } + { + name = "DeutschLernenDeutscheWelle"; + source = ./DeutschLernenDeutscheWelleBridge.php; + } # Music { name = "FipAlbums"; |
