aboutsummaryrefslogtreecommitdiff
path: root/app/views/helpers/feed
diff options
context:
space:
mode:
authorGravatar Jules-Bertholet <jules.bertholet@gmail.com> 2021-03-09 14:51:09 -0500
committerGravatar GitHub <noreply@github.com> 2021-03-09 20:51:09 +0100
commit800a42172db1775aaa76f50446ed914ee0b5a80b (patch)
tree630a0cd33480909ce6f3954a24a2c18c6f343238 /app/views/helpers/feed
parent09b7e87532d030f6a1203a4f0fe5a9746bae694c (diff)
Add an option to set a custom user agent to retrieve individual feeds (#3494)
* Add an option to set a custom user agent to retrieve individual feeds This allows retrieving the original RSS feed when websites use services like FeedBurner. * Use !== instead of != in subscriptionController.php * Add proxy and user-agent to subscription/add Co-authored-by: Georgelemental <georgelemental@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/views/helpers/feed')
-rw-r--r--app/views/helpers/feed/update.phtml59
1 files changed, 36 insertions, 23 deletions
diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml
index 06dc859e1..beb64e5a1 100644
--- a/app/views/helpers/feed/update.phtml
+++ b/app/views/helpers/feed/update.phtml
@@ -328,29 +328,6 @@
</div>
<div class="form-group">
- <label class="group-name" for="path_entries"><?= _t('sub.feed.proxy') ?></label>
- <div class="group-controls">
- <select class="number" name="proxy_type" id="proxy_type"><?php
- $type = '';
- if (is_array($this->feed->attributes('curl_params')) && isset($this->feed->attributes('curl_params')[CURLOPT_PROXYTYPE])) {
- $type = $this->feed->attributes('curl_params')[CURLOPT_PROXYTYPE];
- }
- foreach(['' => '', 3 => 'NONE', 0 => 'HTTP', 2 => 'HTTPS', 4 => 'SOCKS4', 6 => 'SOCKS4A', 5 => 'SOCKS5', 7 => 'SOCKS5H'] as $k => $v) {
- echo '<option value="' . $k . ($type === $k ? '" selected="selected' : '' ) . '">' . $v . '</option>';
- }
- ?>
- </select>
- <div class="stick">
- <input type="text" name="curl_params" id="curl_params" class="extend" value="<?=
- is_array($this->feed->attributes('curl_params')) && !empty($this->feed->attributes('curl_params')[CURLOPT_PROXY]) ?
- $this->feed->attributes('curl_params')[CURLOPT_PROXY] : ''
- ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
- </div>
- <p class="help"><?= _i('help') ?> <?= _t('sub.feed.proxy_help') ?></p>
- </div>
- </div>
-
- <div class="form-group">
<label class="group-name" for="mark_updated_article_unread"><?= _t('conf.reading.mark_updated_article_unread') ?></label>
<div class="group-controls">
<label class="checkbox" for="mark_updated_article_unread">
@@ -386,6 +363,42 @@
</div>
</div>
+ <div class="form-group">
+ <label class="group-name" for="path_entries"><?= _t('sub.feed.useragent') ?></label>
+ <div class="group-controls">
+ <div class="stick">
+ <input type="text" name="curl_params_useragent" id="curl_params_useragent" class="extend" value="<?=
+ is_array($this->feed->attributes('curl_params')) && !empty($this->feed->attributes('curl_params')[CURLOPT_USERAGENT]) ?
+ $this->feed->attributes('curl_params')[CURLOPT_USERAGENT] : ''
+ ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
+ </div>
+ <p class="help"><?= _i('help') ?> <?= _t('sub.feed.useragent_help') ?></p>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <label class="group-name" for="path_entries"><?= _t('sub.feed.proxy') ?></label>
+ <div class="group-controls">
+ <select class="number" name="proxy_type" id="proxy_type"><?php
+ $type = '';
+ if (is_array($this->feed->attributes('curl_params')) && isset($this->feed->attributes('curl_params')[CURLOPT_PROXYTYPE])) {
+ $type = $this->feed->attributes('curl_params')[CURLOPT_PROXYTYPE];
+ }
+ foreach(['' => '', 3 => 'NONE', 0 => 'HTTP', 2 => 'HTTPS', 4 => 'SOCKS4', 6 => 'SOCKS4A', 5 => 'SOCKS5', 7 => 'SOCKS5H'] as $k => $v) {
+ echo '<option value="' . $k . ($type === $k ? '" selected="selected' : '' ) . '">' . $v . '</option>';
+ }
+ ?>
+ </select>
+ <div class="stick">
+ <input type="text" name="curl_params" id="curl_params" class="extend" value="<?=
+ is_array($this->feed->attributes('curl_params')) && !empty($this->feed->attributes('curl_params')[CURLOPT_PROXY]) ?
+ $this->feed->attributes('curl_params')[CURLOPT_PROXY] : ''
+ ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
+ </div>
+ <p class="help"><?= _i('help') ?> <?= _t('sub.feed.proxy_help') ?></p>
+ </div>
+ </div>
+
<?php if (FreshRSS_Auth::hasAccess('admin')) { ?>
<div class="form-group">
<label class="group-name" for="timeout"><?= _t('sub.feed.timeout') ?></label>