chore(post.html): drop post links to mastodon

This commit is contained in:
Cory Dransfeldt 2025-03-28 18:05:15 -07:00
parent c40dcbac2b
commit 6936a96053
No known key found for this signature in database
5 changed files with 1 additions and 25 deletions

View file

@ -50,9 +50,7 @@ abstract class ApiHandler
],
];
if (in_array($method, ["POST", "PATCH"]) && $body) {
$options["json"] = $body;
}
if ($method === "POST" && $body) $options["json"] = $body;
$response = (new Client())->request($method, $url, $options);

View file

@ -83,7 +83,6 @@ class MastodonPostHandler extends ApiHandler
if ($mastodonPostUrl) {
if (strpos($item["link"], $this->baseUrl . "/posts") !== false) {
$slug = str_replace($this->baseUrl, "", $item["link"]);
$this->updatePostWithMastodonUrl($slug, $mastodonPostUrl);
echo "Posted and stored URL: {$item["link"]}\n";
}
} else {
@ -209,15 +208,6 @@ class MastodonPostHandler extends ApiHandler
}
}
private function updatePostWithMastodonUrl(
string $slug,
string $mastodonPostUrl
): void {
$data = ["mastodon_url" => $mastodonPostUrl];
$this->fetchFromPostgREST("posts", "slug=eq.{urlencode($slug)}&mastodon_url=is.null", "PATCH", $data);
}
private function truncateContent(
string $title,
string $description,