From c0535db74214eb0983c7bd145702d9600fc169f2 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 5 Aug 2024 20:37:58 +0000 Subject: [PATCH] Statistics: inbound / outbound for Tumblr and Bluesky --- bluesky/bluesky.php | 2 ++ tumblr/tumblr.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/bluesky/bluesky.php b/bluesky/bluesky.php index 6994b3e3..9f21674f 100644 --- a/bluesky/bluesky.php +++ b/bluesky/bluesky.php @@ -1946,6 +1946,7 @@ function bluesky_post(int $uid, string $url, string $params, array $headers): ?s return null; } + Item::incrementOutbound(Protocol::BLUESKY); try { $curlResult = DI::httpClient()->post($pds . $url, $params, $headers); } catch (\Exception $e) { @@ -1982,6 +1983,7 @@ function bluesky_xrpc_get(int $uid, string $url, array $parameters = []): ?stdCl function bluesky_get(string $url, string $accept_content = HttpClientAccept::DEFAULT, array $opts = []): ?stdClass { + Item::incrementInbound(Protocol::BLUESKY); try { $curlResult = DI::httpClient()->get($url, $accept_content, $opts); } catch (\Exception $e) { diff --git a/tumblr/tumblr.php b/tumblr/tumblr.php index f0c68f33..945f8f35 100644 --- a/tumblr/tumblr.php +++ b/tumblr/tumblr.php @@ -1326,6 +1326,7 @@ function tumblr_get_contact_by_url(string $url, int $uid): ?array */ function tumblr_get(int $uid, string $url, array $parameters = []): stdClass { + Item::incrementInbound(Protocol::TUMBLR); $url = 'https://api.tumblr.com/v2/' . $url; if ($uid == 0) { @@ -1355,6 +1356,7 @@ function tumblr_get(int $uid, string $url, array $parameters = []): stdClass */ function tumblr_post(int $uid, string $url, array $parameters): stdClass { + Item::incrementOutbound(Protocol::TUMBLR); $url = 'https://api.tumblr.com/v2/' . $url; $curlResult = DI::httpClient()->post($url, $parameters, ['Authorization' => ['Bearer ' . tumblr_get_token($uid)]]);