aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controllers')
-rwxr-xr-xapp/Controllers/feedController.php10
-rw-r--r--app/Controllers/subscriptionController.php5
2 files changed, 13 insertions, 2 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index 105099966..2b757177c 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -260,7 +260,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
if (!empty($xPathSettings)) {
$attributes['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);
@@ -298,6 +298,9 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
if (!empty($jsonSettings)) {
$attributes['json_dotnotation'] = $jsonSettings;
}
+ if (Minz_Request::paramString('xPathToJson', plaintext: true) !== '') {
+ $attributes['xPathToJson'] = Minz_Request::paramString('xPathToJson', plaintext: true);
+ }
}
try {
@@ -509,6 +512,11 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
if ($simplePie === null) {
throw new FreshRSS_Feed_Exception('JSON Feed parsing failed for [' . $feed->url(false) . ']');
}
+ } elseif ($feed->kind() === FreshRSS_Feed::KIND_HTML_XPATH_JSON_DOTNOTATION) {
+ $simplePie = $feed->loadJson();
+ if ($simplePie === null) {
+ throw new FreshRSS_Feed_Exception('HTML+XPath+JSON parsing failed for [' . $feed->url(false) . ']');
+ }
} else {
$simplePie = $feed->load(false, $feedIsNew);
}
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));