diff options
author | 2024-07-31 22:57:20 +0300 | |
---|---|---|
committer | 2024-07-31 21:57:20 +0200 | |
commit | b505667168225a74c30e7b58ab6a54bc00c3b89e (patch) | |
tree | be42a07e70159ca090056170ccfd4692e3f63c71 /lib | |
parent | 615c5335878be434a9051278126f7286e1549e14 (diff) | |
download | rss-bridge-b505667168225a74c30e7b58ab6a54bc00c3b89e.tar.gz rss-bridge-b505667168225a74c30e7b58ab6a54bc00c3b89e.tar.zst rss-bridge-b505667168225a74c30e7b58ab6a54bc00c3b89e.zip |
[SubstackBridge] Add Substack bridge (#4174)
* [SubstackBridge] Add Substack
* [SubstackBridge] Add docs
* [SubstackBridge] Fix lint
* [SubstackBridge] Update description
* [SubstackBridge] Update description (x2)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/FeedExpander.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/FeedExpander.php b/lib/FeedExpander.php index fe809bc2..ef001af1 100644 --- a/lib/FeedExpander.php +++ b/lib/FeedExpander.php @@ -7,7 +7,7 @@ abstract class FeedExpander extends BridgeAbstract { private array $feed; - public function collectExpandableDatas(string $url, $maxItems = -1) + public function collectExpandableDatas(string $url, $maxItems = -1, $headers = []) { if (!$url) { throw new \Exception('There is no $url for this RSS expander'); @@ -17,7 +17,7 @@ abstract class FeedExpander extends BridgeAbstract $maxItems = 999; } $accept = [MrssFormat::MIME_TYPE, AtomFormat::MIME_TYPE, '*/*']; - $httpHeaders = ['Accept: ' . implode(', ', $accept)]; + $httpHeaders = array_merge(['Accept: ' . implode(', ', $accept)], $headers); $xmlString = getContents($url, $httpHeaders); if ($xmlString === '') { throw new \Exception(sprintf('Unable to parse xml from `%s` because we got the empty string', $url), 10); |