mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-09 16:38:50 +00:00
added the option for a sessioncookie in heiseBridge (#3596)
* added the option for a sessioncookie with a valid cookie you can get full heise+ (paywall) articles * formating * lint --------- Co-authored-by: Dag <me@dvikan.no>
This commit is contained in:
parent
7661a78a43
commit
d32419ffcf
@ -103,6 +103,16 @@ class HeiseBridge extends FeedExpander
|
|||||||
'required' => false,
|
'required' => false,
|
||||||
'title' => 'Specify number of full articles to return',
|
'title' => 'Specify number of full articles to return',
|
||||||
'defaultValue' => 5
|
'defaultValue' => 5
|
||||||
|
],
|
||||||
|
'sessioncookie' => [
|
||||||
|
'name' => 'Session Cookie',
|
||||||
|
'required' => false,
|
||||||
|
'title' => <<<'TITLE'
|
||||||
|
If you have a heise+ subscription,
|
||||||
|
you can enter your cookie (ssohls) here to
|
||||||
|
have heise+ articles displayed in full.
|
||||||
|
By default the cookie is 1 year valid.
|
||||||
|
TITLE,
|
||||||
]
|
]
|
||||||
]];
|
]];
|
||||||
const LIMIT = 5;
|
const LIMIT = 5;
|
||||||
@ -118,6 +128,7 @@ class HeiseBridge extends FeedExpander
|
|||||||
protected function parseItem($feedItem)
|
protected function parseItem($feedItem)
|
||||||
{
|
{
|
||||||
$item = parent::parseItem($feedItem);
|
$item = parent::parseItem($feedItem);
|
||||||
|
$sessioncookie = $this->getInput('sessioncookie');
|
||||||
|
|
||||||
// strip rss parameter
|
// strip rss parameter
|
||||||
$item['uri'] = explode('?', $item['uri'])[0];
|
$item['uri'] = explode('?', $item['uri'])[0];
|
||||||
@ -128,13 +139,15 @@ class HeiseBridge extends FeedExpander
|
|||||||
}
|
}
|
||||||
|
|
||||||
// abort on heise+ articles and link to archive.ph for full-text content
|
// abort on heise+ articles and link to archive.ph for full-text content
|
||||||
if (str_starts_with($item['title'], 'heise+ |')) {
|
if ($sessioncookie == '' && str_starts_with($item['title'], 'heise+ |')) {
|
||||||
$item['uri'] = 'https://archive.ph/?run=1&url=' . urlencode($item['uri']);
|
$item['uri'] = 'https://archive.ph/?run=1&url=' . urlencode($item['uri']);
|
||||||
return $item;
|
return $item;
|
||||||
}
|
}
|
||||||
|
|
||||||
$item['uri'] .= '?seite=all';
|
$item['uri'] .= '?seite=all';
|
||||||
$article = getSimpleHTMLDOMCached($item['uri']);
|
$article = getSimpleHTMLDOM($item['uri'], [
|
||||||
|
'cookie: ssohls=' . $sessioncookie
|
||||||
|
]);
|
||||||
|
|
||||||
if ($article) {
|
if ($article) {
|
||||||
$article = defaultLinkTo($article, $item['uri']);
|
$article = defaultLinkTo($article, $item['uri']);
|
||||||
|
Loading…
Reference in New Issue
Block a user