aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/subscriptionController.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/Controllers/subscriptionController.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/Controllers/subscriptionController.php')
-rw-r--r--app/Controllers/subscriptionController.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php
index e2e3bbf11..683f403bc 100644
--- a/app/Controllers/subscriptionController.php
+++ b/app/Controllers/subscriptionController.php
@@ -244,7 +244,7 @@ class FreshRSS_subscription_Controller extends FreshRSS_ActionController {
$xPathSettings['itemUid'] = Minz_Request::paramString('xPathItemUid', true);
if (!empty($xPathSettings))
$feed->_attribute('xpath', $xPathSettings);
- } elseif ($feed->kind() === FreshRSS_Feed::KIND_JSON_DOTNOTATION) {
+ } elseif ($feed->kind() === FreshRSS_Feed::KIND_JSON_DOTNOTATION || $feed->kind() === FreshRSS_Feed::KIND_HTML_XPATH_JSON_DOTNOTATION) {
$jsonSettings = [];
if (Minz_Request::paramString('jsonFeedTitle') !== '') {
$jsonSettings['feedTitle'] = Minz_Request::paramString('jsonFeedTitle', true);
@@ -282,6 +282,9 @@ class FreshRSS_subscription_Controller extends FreshRSS_ActionController {
if (!empty($jsonSettings)) {
$feed->_attribute('json_dotnotation', $jsonSettings);
}
+ if (Minz_Request::paramString('xPathToJson', plaintext: true) !== '') {
+ $feed->_attribute('xPathToJson', Minz_Request::paramString('xPathToJson', plaintext: true));
+ }
}
$feed->_attribute('path_entries_filter', Minz_Request::paramString('path_entries_filter', true));