mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 18:14:44 +02:00
fix: rewrite and improve caching (#3594)
This commit is contained in:
parent
a786bbd4e0
commit
4b9f6f7e53
45 changed files with 993 additions and 1169 deletions
|
@ -33,6 +33,7 @@ class AO3Bridge extends BridgeAbstract
|
|||
],
|
||||
]
|
||||
];
|
||||
private $title;
|
||||
|
||||
public function collectData()
|
||||
{
|
||||
|
@ -94,11 +95,12 @@ class AO3Bridge extends BridgeAbstract
|
|||
$url = self::URI . "/works/$id/navigate";
|
||||
$httpClient = RssBridge::getHttpClient();
|
||||
|
||||
$version = 'v0.0.1';
|
||||
$response = $httpClient->request($url, [
|
||||
'useragent' => 'rss-bridge bot (https://github.com/RSS-Bridge/rss-bridge)',
|
||||
'useragent' => "rss-bridge $version (https://github.com/RSS-Bridge/rss-bridge)",
|
||||
]);
|
||||
|
||||
$html = \str_get_html($response['body']);
|
||||
$html = \str_get_html($response->getBody());
|
||||
$html = defaultLinkTo($html, self::URI);
|
||||
|
||||
$this->title = $html->find('h2 a', 0)->plaintext;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue