0
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-30 23:35:42 +00:00

fix http timeout

This commit is contained in:
mruac 2025-08-10 02:25:08 +09:30
parent 37174f01e5
commit c74a377a4d

View File

@ -595,15 +595,21 @@ class BlueskyBridge extends BridgeAbstract
private function resolveHandle($handle)
{
$uri = 'https://public.api.bsky.app/xrpc/com.atproto.identity.resolveHandle?handle=' . urlencode($handle);
$response = json_decode(getContents($uri), true);
$url = 'https://public.api.bsky.app/xrpc/com.atproto.identity.resolveHandle?handle=' . urlencode($handle);
$response = $this->loadCacheValue($url) ?? json_decode(getContents($url), true);
if (isset($response['did'])) {
$this->saveCacheValue($url, $response, 604800);
}
return $response['did'];
}
private function getProfile($did)
{
$uri = 'https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=' . urlencode($did);
$response = json_decode(getContents($uri), true);
$url = 'https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=' . urlencode($did);
$response = $this->loadCacheValue($url) ?? json_decode(getContents($url), true);
if ($response['did'] === $did ?? false) {
$this->saveCacheValue($url, $response);
}
return $response;
}