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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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"'