aboutsummaryrefslogtreecommitdiff
path: root/app/Services/ImportService.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-10-13 15:28:45 +0200
committerGravatar GitHub <noreply@github.com> 2024-10-13 15:28:45 +0200
commitccb132523a4ee740d5b576574e9f44668021fbe6 (patch)
tree0b6977a345c56eff277abb0bc9199b0010f003a8 /app/Services/ImportService.php
parent91624037c7d73eb545478aab2f8abc55fc224453 (diff)
New feed mode: HTML + XPath + JSON dot notation (JSON in HTML) (#6888)
* New feed mode: HTML + XPath + JSON dot notation (JSON in HTML) Same as `JSON+DotNotation` but first extracting the JSON string from an HTML document thanks to an XPath expression. Example: `//script[@type='application/json']` fix https://github.com/FreshRSS/FreshRSS/discussions/6876 * JavaScript UI to show/hide new field * Casing xPathToJson * Slight renaming
Diffstat (limited to 'app/Services/ImportService.php')
-rw-r--r--app/Services/ImportService.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/Services/ImportService.php b/app/Services/ImportService.php
index 1871c37e0..298c0ec21 100644
--- a/app/Services/ImportService.php
+++ b/app/Services/ImportService.php
@@ -168,6 +168,9 @@ class FreshRSS_Import_Service {
case strtolower(FreshRSS_Export_Service::TYPE_JSONFEED):
$feed->_kind(FreshRSS_Feed::KIND_JSONFEED);
break;
+ case strtolower(FreshRSS_Export_Service::TYPE_HTML_XPATH_JSON_DOTNOTATION):
+ $feed->_kind(FreshRSS_Feed::KIND_HTML_XPATH_JSON_DOTNOTATION);
+ break;
default:
$feed->_kind(FreshRSS_Feed::KIND_RSS);
break;
@@ -257,6 +260,7 @@ class FreshRSS_Import_Service {
if (!empty($jsonSettings)) {
$feed->_attribute('json_dotnotation', $jsonSettings);
}
+ $feed->_attribute('xPathToJson', $feed_elt['frss:xPathToJson'] ?? null);
$curl_params = [];
if (isset($feed_elt['frss:CURLOPT_COOKIE'])) {