1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-09 01:56:39 +02:00

fix: rewrite and improve caching (#3594)

This commit is contained in:
Dag
2023-09-10 21:50:15 +02:00
committed by GitHub
parent a786bbd4e0
commit 4b9f6f7e53
45 changed files with 993 additions and 1169 deletions

View File

@@ -15,14 +15,17 @@ while ($next) { /* Collect all contributors */
'User-Agent' => 'RSS-Bridge',
];
$httpClient = new CurlHttpClient();
$result = $httpClient->request($url, ['headers' => $headers]);
$response = $httpClient->request($url, ['headers' => $headers]);
foreach (json_decode($result['body']) as $contributor) {
$json = $response->getBody();
$json_decode = Json::decode($json, false);
foreach ($json_decode as $contributor) {
$contributors[] = $contributor;
}
// Extract links to "next", "last", etc...
$links = explode(',', $result['headers']['link'][0]);
$link1 = $response->getHeader('link');
$links = explode(',', $link1);
$next = false;
// Check if there is a link with 'rel="next"'