From 52c3597a1f281e40a400375b0e6cad3ef32a19e2 Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sun, 13 Nov 2022 23:00:22 +0100 Subject: config: services: web: quentin: use new website --- config/services/web/quentin/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/services') diff --git a/config/services/web/quentin/default.nix b/config/services/web/quentin/default.nix index 8456565..f284071 100644 --- a/config/services/web/quentin/default.nix +++ b/config/services/web/quentin/default.nix @@ -3,7 +3,7 @@ { services.nginx.virtualHosts.quentin = { serverName = "quentin.${config.networking.domain}"; - locations."/".root = "${pkgs.personal.academic-webpage}"; + locations."/".root = "${pkgs.personal.webpage}"; forceSSL = true; enableACME = true; }; -- cgit v1.2.3 From 5260c8daee219adab6188b794d643c63b1617379 Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sun, 27 Nov 2022 01:14:01 +0100 Subject: services: web: rss: add Mubi bridge --- config/services/web/rss/MubiBridge.php | 68 ++++++++++++++++++++++++++++++++++ config/services/web/rss/default.nix | 11 ++++-- 2 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 config/services/web/rss/MubiBridge.php (limited to 'config/services') diff --git a/config/services/web/rss/MubiBridge.php b/config/services/web/rss/MubiBridge.php new file mode 100644 index 0000000..f1c24dc --- /dev/null +++ b/config/services/web/rss/MubiBridge.php @@ -0,0 +1,68 @@ +primary_film_group)) { + return $obj->primary_film_group->description_html . '
'; + } else { + return ''; + } +} + +class MubiBridge extends XPathAbstract { + const NAME = 'Mubi Bridge'; + const URI = 'https://mubi.com'; + const DESCRIPTION = 'Mubi\'s film of the day.'; + const MAINTAINER = 'Quentin Aristote'; + const CACHE_TIMEOUT = 21600; // 6h + + const PARAMETERS = [ + '' => [ + 'language' => [ + 'name' => 'Language', + 'type' => 'string', + 'required' => 'true', + 'exampleValue' => 'en / de / es / fr / it / nl / pt / tr' + ] + ] + ]; + + public function getIcon() { + return 'https://mubi.com/favicon.ico'; + } + + public function getUri() { + return self::URI . '/' . $this->getInput('language') . '/film-of-the-day'; + } + + public function collectData() { + $dataJsonStr = extractFromDelimiters( + getSimpleHTMLDOMCached($this->getUri()), + ''); + $data = json_decode($dataJsonStr)->props->initialState; + foreach ($data->filmProgramming->filmProgrammings as $filmProgramming) { + $id = $filmProgramming->filmId; + $film = $data->film->films->{$id}; + $item = [ + 'title' => $filmProgramming->email_subject, + 'uri' => 'https://mubi.com/' . $this->getInput('language') . '/films/' . $film->slug, + 'timestamp' => strtotime($filmProgramming->available_at), + 'author' => $film->directors[0]->name, + 'content' => ( + $filmProgramming->our_take_html . '
' . + tryGetDescription($filmProgramming) . + $film->short_synopsis_html . '
' . + $film->default_editorial_html + ), + 'enclosures' => [ + $film->stills->standard, + $film->trailer_url + ], + 'categories' => $film->genres, + 'uid' => $id . $filmProgramming->available_at + ]; + $this->items[] = $item; + } + } +} diff --git a/config/services/web/rss/default.nix b/config/services/web/rss/default.nix index 4d7dd18..776402a 100644 --- a/config/services/web/rss/default.nix +++ b/config/services/web/rss/default.nix @@ -2,12 +2,15 @@ let cfg = config.services.rss-bridge; - debug = false; + debug = true; rss-bridge = pkgs.rss-bridge.overrideAttrs (oldAttrs: oldAttrs // { installPhase = oldAttrs.installPhase + '' - ln -sf ${./ParisJazzClubBridge.php} $out/bridges/ParisJazzClubBridge.php - ln -sf ${./MaisonDeLaRadioBridge.php} $out/bridges/MaisonDeLaRadioBridge.php + pushd $out/bridges + ln -sf ${./ParisJazzClubBridge.php} ParisJazzClubBridge.php + ln -sf ${./MaisonDeLaRadioBridge.php} MaisonDeLaRadioBridge.php + ln -sf ${./MubiBridge.php} MubiBridge.php + popd '' + lib.optionalString debug '' touch $out/DEBUG ''; @@ -15,7 +18,7 @@ let in { services.rss-bridge = { enable = true; - whitelist = [ "ParisJazzClub" "MaisonDeLaRadio" ]; + whitelist = [ "ParisJazzClub" "MaisonDeLaRadio" "Mubi" ]; virtualHost = "rss"; }; -- cgit v1.2.3 From b3e31416ccf7cacbac4d2f4efef7dd28fe3ec493 Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sun, 27 Nov 2022 01:18:39 +0100 Subject: services: web: rss: disable debug mode --- config/services/web/rss/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/services') diff --git a/config/services/web/rss/default.nix b/config/services/web/rss/default.nix index 776402a..8975d14 100644 --- a/config/services/web/rss/default.nix +++ b/config/services/web/rss/default.nix @@ -2,7 +2,7 @@ let cfg = config.services.rss-bridge; - debug = true; + debug = false; rss-bridge = pkgs.rss-bridge.overrideAttrs (oldAttrs: oldAttrs // { installPhase = oldAttrs.installPhase + '' -- cgit v1.2.3 From b35b47155a6989f7644cbb7be82a388c1840a0f6 Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sun, 27 Nov 2022 01:26:00 +0100 Subject: services: web: rss: Mubi: fix language parameter --- config/services/web/rss/MubiBridge.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'config/services') diff --git a/config/services/web/rss/MubiBridge.php b/config/services/web/rss/MubiBridge.php index f1c24dc..992f463 100644 --- a/config/services/web/rss/MubiBridge.php +++ b/config/services/web/rss/MubiBridge.php @@ -20,9 +20,9 @@ class MubiBridge extends XPathAbstract { '' => [ 'language' => [ 'name' => 'Language', - 'type' => 'string', - 'required' => 'true', - 'exampleValue' => 'en / de / es / fr / it / nl / pt / tr' + 'type' => 'text', + 'exampleValue' => 'en / de / es / fr / it / nl / pt / tr', + 'defaultValue' => 'en' ] ] ]; -- cgit v1.2.3 From 0c0affb59873dd265719a7293dfde6f76495c612 Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sun, 27 Nov 2022 13:12:19 +0100 Subject: services: web: rss: Mubi: replace with What's On Mubi --- config/services/web/rss/MubiBridge.php | 68 --------------------------- config/services/web/rss/WhatsOnMubiBridge.php | 49 +++++++++++++++++++ config/services/web/rss/default.nix | 4 +- 3 files changed, 51 insertions(+), 70 deletions(-) delete mode 100644 config/services/web/rss/MubiBridge.php create mode 100644 config/services/web/rss/WhatsOnMubiBridge.php (limited to 'config/services') diff --git a/config/services/web/rss/MubiBridge.php b/config/services/web/rss/MubiBridge.php deleted file mode 100644 index 992f463..0000000 --- a/config/services/web/rss/MubiBridge.php +++ /dev/null @@ -1,68 +0,0 @@ -primary_film_group)) { - return $obj->primary_film_group->description_html . '
'; - } else { - return ''; - } -} - -class MubiBridge extends XPathAbstract { - const NAME = 'Mubi Bridge'; - const URI = 'https://mubi.com'; - const DESCRIPTION = 'Mubi\'s film of the day.'; - const MAINTAINER = 'Quentin Aristote'; - const CACHE_TIMEOUT = 21600; // 6h - - const PARAMETERS = [ - '' => [ - 'language' => [ - 'name' => 'Language', - 'type' => 'text', - 'exampleValue' => 'en / de / es / fr / it / nl / pt / tr', - 'defaultValue' => 'en' - ] - ] - ]; - - public function getIcon() { - return 'https://mubi.com/favicon.ico'; - } - - public function getUri() { - return self::URI . '/' . $this->getInput('language') . '/film-of-the-day'; - } - - public function collectData() { - $dataJsonStr = extractFromDelimiters( - getSimpleHTMLDOMCached($this->getUri()), - ''); - $data = json_decode($dataJsonStr)->props->initialState; - foreach ($data->filmProgramming->filmProgrammings as $filmProgramming) { - $id = $filmProgramming->filmId; - $film = $data->film->films->{$id}; - $item = [ - 'title' => $filmProgramming->email_subject, - 'uri' => 'https://mubi.com/' . $this->getInput('language') . '/films/' . $film->slug, - 'timestamp' => strtotime($filmProgramming->available_at), - 'author' => $film->directors[0]->name, - 'content' => ( - $filmProgramming->our_take_html . '
' . - tryGetDescription($filmProgramming) . - $film->short_synopsis_html . '
' . - $film->default_editorial_html - ), - 'enclosures' => [ - $film->stills->standard, - $film->trailer_url - ], - 'categories' => $film->genres, - 'uid' => $id . $filmProgramming->available_at - ]; - $this->items[] = $item; - } - } -} diff --git a/config/services/web/rss/WhatsOnMubiBridge.php b/config/services/web/rss/WhatsOnMubiBridge.php new file mode 100644 index 0000000..4cf7718 --- /dev/null +++ b/config/services/web/rss/WhatsOnMubiBridge.php @@ -0,0 +1,49 @@ + [ + 'country' => [ + 'name' => 'Country', + 'type' => 'text', + 'exampleValue' => 'fr', + 'defaultValue' => 'fr', + ] + ] + ]; + + const XPATH_EXPRESSION_ITEM = '//div[@class="film"]'; + const XPATH_EXPRESSION_ITEM_TITLE = './/h2'; + const XPATH_EXPRESSION_ITEM_CONTENT = './/div[@class="film_details flex flex-col flex-1"]'; + const XPATH_EXPRESSION_ITEM_URI = './/a[@class="relative film_thumbnail"]/@href'; + const XPATH_EXPRESSION_ITEM_AUTHOR = './@data-directors'; + const XPATH_EXPRESSION_ITEM_TIMESTAMP = './/p[@class="hidden film-expires"]'; + const XPATH_EXPRESSION_ITEM_ENCLOSURES = './/a[@class="relative film_thumbnail"]/img/@src'; + const XPATH_EXPRESSION_ITEM_CATEGORIES = './/div[@class="film_details flex flex-col flex-1"]//div[@class="mt-3 flex flex-wrap"]'; + + public function getSourceUrl() { + return self::URI . '&showing=' . $this->getInput('country'); + } + + public function getIcon() { + return 'https://whatsonmubi.com/favicon.ico'; + } + + protected function formatItemTimestamp($value) { + return strtotime('today +' . $value); + } + + protected function formatItemContent($value) { + $text = preg_replace("/\s{2}\s+/", "\n", $value); + $lines = array_map("trim", explode("\n", $text)); + $title = $lines[0]; + $director = $lines[1]; + return $director . ' ' . $title; + } +} diff --git a/config/services/web/rss/default.nix b/config/services/web/rss/default.nix index 8975d14..2c5d515 100644 --- a/config/services/web/rss/default.nix +++ b/config/services/web/rss/default.nix @@ -9,7 +9,7 @@ let pushd $out/bridges ln -sf ${./ParisJazzClubBridge.php} ParisJazzClubBridge.php ln -sf ${./MaisonDeLaRadioBridge.php} MaisonDeLaRadioBridge.php - ln -sf ${./MubiBridge.php} MubiBridge.php + ln -sf ${./WhatsOnMubiBridge.php} WhatsOnMubiBridge.php popd '' + lib.optionalString debug '' touch $out/DEBUG @@ -18,7 +18,7 @@ let in { services.rss-bridge = { enable = true; - whitelist = [ "ParisJazzClub" "MaisonDeLaRadio" "Mubi" ]; + whitelist = [ "ParisJazzClub" "MaisonDeLaRadio" "WhatsOnMubi" ]; virtualHost = "rss"; }; -- cgit v1.2.3 From efa28a3baa12cac85f4cfc8665f1cf8762b9d7ee Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sun, 27 Nov 2022 16:28:24 +0100 Subject: services: web: rss: add fip bridge --- config/services/web/rss/FipAlbumsBridge.php | 41 +++++++++++++++++++++++++++++ config/services/web/rss/default.nix | 5 ++-- 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 config/services/web/rss/FipAlbumsBridge.php (limited to 'config/services') diff --git a/config/services/web/rss/FipAlbumsBridge.php b/config/services/web/rss/FipAlbumsBridge.php new file mode 100644 index 0000000..dfc3930 --- /dev/null +++ b/config/services/web/rss/FipAlbumsBridge.php @@ -0,0 +1,41 @@ + [ + 'category' => [ + 'name' => 'Category', + 'type' => 'text', + 'description' => 'See examples for available options.', + 'exampleValue' => 'can be empty, "selections" or "album-jazz-de-la-semaine"' + ] + ] + ]; + + const XPATH_EXPRESSION_ITEM = '//div[@class="Card Basic list squaredVisual"]'; + const XPATH_EXPRESSION_ITEM_TITLE = './/a/@title'; + const XPATH_EXPRESSION_ITEM_CONTENT = './div[1]'; + const XPATH_EXPRESSION_ITEM_URI = './/a/@href'; + const XPATH_EXPRESSION_ITEM_AUTHOR = './/div[@class="CardDetails fullWidth"]/div[2]'; + const XPATH_EXPRESSION_ITEM_TIMESTAMP = './/time/@datetime'; + const XPATH_EXPRESSION_ITEM_ENCLOSURES = './/img/@src'; + const XPATH_EXPRESSION_ITEM_CATEGORIES = './/div[@class="CardDetails fullWidth"]/div[3]'; + + public function getSourceUrl() { + return self::URI . $this->getInput('category'); + } + + public function getIcon() { + return 'https://www.radiofrance.fr/dist/favicons/fip/favicon.png'; + } + + protected function formatItemTimestamp($value) { + return strtotime('today +' . $value); + } +} diff --git a/config/services/web/rss/default.nix b/config/services/web/rss/default.nix index 2c5d515..18a6763 100644 --- a/config/services/web/rss/default.nix +++ b/config/services/web/rss/default.nix @@ -2,13 +2,14 @@ let cfg = config.services.rss-bridge; - debug = false; + debug = true; rss-bridge = pkgs.rss-bridge.overrideAttrs (oldAttrs: oldAttrs // { installPhase = oldAttrs.installPhase + '' pushd $out/bridges ln -sf ${./ParisJazzClubBridge.php} ParisJazzClubBridge.php ln -sf ${./MaisonDeLaRadioBridge.php} MaisonDeLaRadioBridge.php + ln -sf ${./FipAlbumsBridge.php} FipAlbumsBridge.php ln -sf ${./WhatsOnMubiBridge.php} WhatsOnMubiBridge.php popd '' + lib.optionalString debug '' @@ -18,7 +19,7 @@ let in { services.rss-bridge = { enable = true; - whitelist = [ "ParisJazzClub" "MaisonDeLaRadio" "WhatsOnMubi" ]; + whitelist = [ "ParisJazzClub" "MaisonDeLaRadio" "FipAlbumsBridge" "WhatsOnMubi" ]; virtualHost = "rss"; }; -- cgit v1.2.3 From 4a24f168e3fb44073237d9aca95a97e77bdefa3c Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sun, 27 Nov 2022 17:41:34 +0100 Subject: services: web: rss: make configuration into a module --- config/services/web/rss/default.nix | 53 ++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 16 deletions(-) (limited to 'config/services') diff --git a/config/services/web/rss/default.nix b/config/services/web/rss/default.nix index 18a6763..acc9331 100644 --- a/config/services/web/rss/default.nix +++ b/config/services/web/rss/default.nix @@ -2,31 +2,52 @@ let cfg = config.services.rss-bridge; - debug = true; - rss-bridge = pkgs.rss-bridge.overrideAttrs (oldAttrs: - oldAttrs // { - installPhase = oldAttrs.installPhase + '' - pushd $out/bridges - ln -sf ${./ParisJazzClubBridge.php} ParisJazzClubBridge.php - ln -sf ${./MaisonDeLaRadioBridge.php} MaisonDeLaRadioBridge.php - ln -sf ${./FipAlbumsBridge.php} FipAlbumsBridge.php - ln -sf ${./WhatsOnMubiBridge.php} WhatsOnMubiBridge.php - popd - '' + lib.optionalString debug '' - touch $out/DEBUG - ''; - }); + # debug = true; + # rss-bridge = pkgs.rss-bridge.overrideAttrs (oldAttrs: + # oldAttrs // { + # installPhase = oldAttrs.installPhase + '' + # pushd $out/bridges + # ln -sf ${./ParisJazzClubBridge.php} ParisJazzClubBridge.php + # ln -sf ${./MaisonDeLaRadioBridge.php} MaisonDeLaRadioBridge.php + # ln -sf ${./FipAlbumsBridge.php} FipAlbumsBridge.php + # ln -sf ${./WhatsOnMubiBridge.php} WhatsOnMubiBridge.php + # popd + # '' + lib.optionalString debug '' + # touch $out/DEBUG + # ''; + # }); in { services.rss-bridge = { enable = true; - whitelist = [ "ParisJazzClub" "MaisonDeLaRadio" "FipAlbumsBridge" "WhatsOnMubi" ]; + # whitelist = [ "ParisJazzClub" "MaisonDeLaRadio" "FipAlbumsBridge" "WhatsOnMubi" ]; + extraBridges = [ + # Music + { + name = "FipAlbums"; + source = ./FipAlbumsBridge.php; + } + ## Concerts + { + name = "ParisJazzClub"; + source = ./ParisJazzClubBridge.php; + } + { + name = "MaisonDeLaRadio"; + source = ./MaisonDeLaRadioBridge.php; + } + # Cinema + { + name = "WhatsOnMubi"; + source = ./WhatsOnMubiBridge.php; + } + ]; virtualHost = "rss"; }; services.nginx = lib.mkIf (cfg.virtualHost != null) { virtualHosts.${cfg.virtualHost} = { serverName = "rss.${config.networking.domain}"; - root = lib.mkForce "${rss-bridge}"; + # root = lib.mkForce "${rss-bridge}"; forceSSL = true; enableACME = true; }; -- cgit v1.2.3 From dc278c9ef8377e2405698f17c0406c393465a65a Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sun, 27 Nov 2022 17:46:39 +0100 Subject: services: web: rss: remove extra comments --- config/services/web/rss/default.nix | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'config/services') diff --git a/config/services/web/rss/default.nix b/config/services/web/rss/default.nix index acc9331..a6da155 100644 --- a/config/services/web/rss/default.nix +++ b/config/services/web/rss/default.nix @@ -2,24 +2,9 @@ let cfg = config.services.rss-bridge; - # debug = true; - # rss-bridge = pkgs.rss-bridge.overrideAttrs (oldAttrs: - # oldAttrs // { - # installPhase = oldAttrs.installPhase + '' - # pushd $out/bridges - # ln -sf ${./ParisJazzClubBridge.php} ParisJazzClubBridge.php - # ln -sf ${./MaisonDeLaRadioBridge.php} MaisonDeLaRadioBridge.php - # ln -sf ${./FipAlbumsBridge.php} FipAlbumsBridge.php - # ln -sf ${./WhatsOnMubiBridge.php} WhatsOnMubiBridge.php - # popd - # '' + lib.optionalString debug '' - # touch $out/DEBUG - # ''; - # }); in { services.rss-bridge = { enable = true; - # whitelist = [ "ParisJazzClub" "MaisonDeLaRadio" "FipAlbumsBridge" "WhatsOnMubi" ]; extraBridges = [ # Music { @@ -47,7 +32,6 @@ in { services.nginx = lib.mkIf (cfg.virtualHost != null) { virtualHosts.${cfg.virtualHost} = { serverName = "rss.${config.networking.domain}"; - # root = lib.mkForce "${rss-bridge}"; forceSSL = true; enableACME = true; }; -- cgit v1.2.3 From 58db771dfbbf71a471ed92b324d2cbe16a1e0b12 Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sun, 27 Nov 2022 20:00:23 +0100 Subject: services: web: rss: add paris-cine.info bridge --- config/services/web/rss/ParisCineInfoBridge.php | 98 +++++++++++++++++++++++++ config/services/web/rss/default.nix | 7 +- 2 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 config/services/web/rss/ParisCineInfoBridge.php (limited to 'config/services') diff --git a/config/services/web/rss/ParisCineInfoBridge.php b/config/services/web/rss/ParisCineInfoBridge.php new file mode 100644 index 0000000..5e418b4 --- /dev/null +++ b/config/services/web/rss/ParisCineInfoBridge.php @@ -0,0 +1,98 @@ + [ + // TODO add an option for choosing the reviewer + 'card' => [ + 'name' => 'Card', + 'type' => 'text', + 'title' => 'Fidelity / subscription card.', + 'exampleValue' => 'ugc', + 'defaultValue' => 'all' + ], + 'dayid' => [ + 'name' => 'Day of the week', + 'type' => 'text', + 'title' => 'Comma-separated list of integers (0 means everyday, 1 means Sunday, etc.)/', + 'exampleValue' => '1,3,6', + 'defaultValue' => '0' + ], + 'time' => [ + 'name' => 'Time of day', + 'type' => 'text', + 'title' => 'Morning (8AM-12AM), Afternoon (12AM-18PM), Evening (18PM-12PM).', + 'exampleValue' => 'soir', + 'defaultValue' => 'all' + ], + 'addr' => [ + 'name' => 'Location', + 'type' => 'text', + 'title' => 'Comma-separated list of districts or cities.', + 'exampleValue' => '13e,Châtillon', + 'defaultValue' => 'Paris' + ], + 'cine' => [ + 'name' => 'Theater', + 'type' => 'text', + 'title' => 'ID of a movie theater.', + 'exampleValue' => 'C0150', + ], + 'format' => [ + 'name' => 'Format', + 'type' => 'text', + 'title' => 'Movie format.', + 'exampleValue' => '3D' + ] + ] + ]; + + public function getSourceUrl() { + $query = ''; + foreach(self::PARAMETERS['Filters'] as $param => $val) { + $value = $this->getInput($param); + if ($value != '') { + $query = $query . 'sel' . $param . '=' . $value . '&'; + } + } + $selday = ['week', 'dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'][$this->getInput('dayid')]; + return self::URI . 'get_pcimovies.php?' . $query . 'selday=' . $selday; + } + + private function fetchData() { + return json_decode(getSimpleHTMLDOMCached($this->getSourceUrl()))->data; + } + + public function getIcon() { + return 'https://paris-cine.info/resources/img/favicon-16x16.png'; + } + + public function collectData() { + $data = $this->fetchData(); + foreach($data as $film) { + $item = [ + 'uri' => str_replace('\\/', '/', $film->sc_url), + 'title' => $film->title, + 'timestamp' => str_replace('/', '-', $film->released), + 'author' => $film->dir, + 'content' => ( + $film->year . ' - ' . + 'with ' . str_replace(',', ', ', $film->actors) . ' - ' . + $film->duration . ' - ' . + 'SC: ' . $film->sc_rating . '/10 - ' . + 'IMDB: ' . $film->imdbr . '/10' . ' ' + ), + 'enclosures' => [ $film->poster_url ], + 'categories' => explode(',', $film->genre), + 'id' => $film->id + ]; + $this->items[] = $item; + } + } +} diff --git a/config/services/web/rss/default.nix b/config/services/web/rss/default.nix index a6da155..f2b667b 100644 --- a/config/services/web/rss/default.nix +++ b/config/services/web/rss/default.nix @@ -1,7 +1,6 @@ { config, lib, pkgs, ... }: -let - cfg = config.services.rss-bridge; +let cfg = config.services.rss-bridge; in { services.rss-bridge = { enable = true; @@ -25,6 +24,10 @@ in { name = "WhatsOnMubi"; source = ./WhatsOnMubiBridge.php; } + { + name = "ParisCineInfo"; + source = ./ParisCineInfoBridge.php; + } ]; virtualHost = "rss"; }; -- cgit v1.2.3 From 3221a771ee11e18c6cb3eb2a654626259ab134c1 Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sun, 4 Dec 2022 13:09:47 +0100 Subject: services: web: rss: fip: debug xpaths --- config/services/web/rss/FipAlbumsBridge.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'config/services') diff --git a/config/services/web/rss/FipAlbumsBridge.php b/config/services/web/rss/FipAlbumsBridge.php index dfc3930..b8ec64d 100644 --- a/config/services/web/rss/FipAlbumsBridge.php +++ b/config/services/web/rss/FipAlbumsBridge.php @@ -18,14 +18,14 @@ class FipAlbumsBridge extends XPathAbstract { ] ]; - const XPATH_EXPRESSION_ITEM = '//div[@class="Card Basic list squaredVisual"]'; + const XPATH_EXPRESSION_ITEM = '//div[starts-with(@class, "CardAlbum ")]'; const XPATH_EXPRESSION_ITEM_TITLE = './/a/@title'; - const XPATH_EXPRESSION_ITEM_CONTENT = './div[1]'; + const XPATH_EXPRESSION_ITEM_CONTENT = './/img/@alt'; const XPATH_EXPRESSION_ITEM_URI = './/a/@href'; - const XPATH_EXPRESSION_ITEM_AUTHOR = './/div[@class="CardDetails fullWidth"]/div[2]'; + const XPATH_EXPRESSION_ITEM_AUTHOR = './/div[starts-with(@class, "CardAlbum-details ")]/div[2]'; const XPATH_EXPRESSION_ITEM_TIMESTAMP = './/time/@datetime'; const XPATH_EXPRESSION_ITEM_ENCLOSURES = './/img/@src'; - const XPATH_EXPRESSION_ITEM_CATEGORIES = './/div[@class="CardDetails fullWidth"]/div[3]'; + const XPATH_EXPRESSION_ITEM_CATEGORIES = './/div[starts-with(@class, "CardDetails-label ")]/span[2]'; public function getSourceUrl() { return self::URI . $this->getInput('category'); -- cgit v1.2.3 From 3362029ceb7076c9351ffac34133669faf661ac1 Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sun, 4 Dec 2022 13:11:10 +0100 Subject: services: web: searx: engines: update to v1.1.0 --- config/services/web/searx/searx/engines.nix | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'config/services') diff --git a/config/services/web/searx/searx/engines.nix b/config/services/web/searx/searx/engines.nix index 5e4609a..76f0ca8 100644 --- a/config/services/web/searx/searx/engines.nix +++ b/config/services/web/searx/searx/engines.nix @@ -54,7 +54,7 @@ in { # files "btdigg" # images - "ccengine" + "openverse" "bing images" "library of congress" "qwant images" @@ -96,28 +96,6 @@ in { results = "HTML"; }; } - { # Emojipedia - name = "emojipedia"; - engine = "xpath"; - search_url = makeSearchUrl { - baseUrl = "https://emojipedia.org/search/"; - queryKeyword = "q"; - }; - results_xpath = ''//ol[@class="search-results"]/li/h2''; - url_xpath = "./a/@href"; - title_xpath = "./a"; - content_xpath = "../p"; - shortcut = "emoji"; - disabled = true; - about = { - website = "https://emojipedia.org/"; - wikidata_id = "Q22908129"; - official_api_documentation = ""; - use_official_api = false; - require_api_key = false; - results = "HTML"; - }; - } { name = "nlab"; engine = "xpath"; -- cgit v1.2.3 From 9bde3c4624eb916bafcf9a18792edb42e3a25a17 Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Tue, 20 Dec 2022 22:29:23 +0100 Subject: searx: engines: wikipedia: fix xpath and test --- config/services/web/searx/searx/engines.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'config/services') diff --git a/config/services/web/searx/searx/engines.nix b/config/services/web/searx/searx/engines.nix index 76f0ca8..5256c27 100644 --- a/config/services/web/searx/searx/engines.nix +++ b/config/services/web/searx/searx/engines.nix @@ -29,9 +29,9 @@ let extraParameters = { fulltext = 1; }; }; results_xpath = ''//ul[@class="mw-search-results"]/li''; - url_xpath = ''./div[@class="mw-search-result-heading"]/a/@href''; - title_xpath = ''./div[@class="mw-search-result-heading"]/a''; - content_xpath = ''./div[@class="searchresult"]''; + url_xpath = ''.//div[@class="mw-search-result-heading"]/a/@href''; + title_xpath = ''.//div[@class="mw-search-result-heading"]/a/@title''; + content_xpath = ''.//div[@class="searchresult"]''; shortcut = "w${lang}"; categories = "general"; disabled = true; -- cgit v1.2.3