diff options
| author | quentin@aristote.fr <quentin@aristote.fr> | 2026-11-29 17:24:18 +0100 |
|---|---|---|
| committer | quentin@aristote.fr <quentin@aristote.fr> | 2026-11-29 17:42:35 +0100 |
| commit | ce831333a24011d0692f6871047fe74eab9fab8c (patch) | |
| tree | 9bb971e2afe0a4b22c73274e8b8e8d05d014401d /config/services/web/rss/RandonavigoBridge.php | |
| download | hermaphroditos-ce831333a24011d0692f6871047fe74eab9fab8c.tar.gz hermaphroditos-ce831333a24011d0692f6871047fe74eab9fab8c.tar.bz2 hermaphroditos-ce831333a24011d0692f6871047fe74eab9fab8c.tar.xz | |
initial commit
Diffstat (limited to 'config/services/web/rss/RandonavigoBridge.php')
| -rw-r--r-- | config/services/web/rss/RandonavigoBridge.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/config/services/web/rss/RandonavigoBridge.php b/config/services/web/rss/RandonavigoBridge.php new file mode 100644 index 0000000..ebc64c2 --- /dev/null +++ b/config/services/web/rss/RandonavigoBridge.php @@ -0,0 +1,33 @@ +<?php + +class RandonavigoBridge extends XPathAbstract { + const NAME = 'Randonavigo Bridge'; + const URI = 'https://www.randonavigo.fr/'; + const DESCRIPTION = 'Hiking trails in Île-de-France.'; + const MAINTAINER = 'Quentin Aristote'; + const CACHE_TIMEOUT = 86400; // 24h + + const FEED_SOURCE_URL = 'https://www.randonavigo.fr/'; + const XPATH_EXPRESSION_ITEM = '//article'; + const XPATH_EXPRESSION_ITEM_TITLE = './/h2/a/text()'; + const XPATH_EXPRESSION_ITEM_CONTENT = './div/div[1]/div[2]/text()'; + const XPATH_EXPRESSION_ITEM_URI = './a/@href'; + const XPATH_EXPRESSION_ITEM_AUTHOR = './div/div[1]/div[1]/div/text()'; + const XPATH_EXPRESSION_ITEM_TIMESTAMP = './a/@href'; + const XPATH_EXPRESSION_ITEM_ENCLOSURES = './a//img/@src'; + const XPATH_EXPRESSION_ITEM_CATEGORIES = './div/div[2]//a/@title'; + + public function getIcon() { + return 'https://www.randonavigo.fr/apple-touch-icon.png'; + } + + protected function formatItemTimestamp($value) { + $pattern = "/\/([0-9]+)/"; + preg_match_all($pattern, $value, $matches); + return strtotime(join('-', $matches[1])); + } + + protected function cleanMediaUrl($value) { + return $value; + } +} |
