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:
parent
37174f01e5
commit
c74a377a4d
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user