Add logging to mastodon Syndicating

This commit is contained in:
2023-01-29 13:24:57 +11:00
parent 5ee2ff25c5
commit 14a5cbeec0

View File

@@ -14,7 +14,7 @@ module Adamantium
return Failure(:no_mastodon_credentials)
end
text = post[:name]
text = (post[:name] != "") ? post[:name] : post[:content]
text_with_link = "#{text}#{settings.micropub_site_url}"
tags = post[:category].map { |tag| "##{tag}" }.join(" ")
text_with_tags = "#{text_with_link} #{tags}"
@@ -23,6 +23,8 @@ module Adamantium
mastodon_token = settings.mastodon_token
mastodon_server = settings.mastodon_server.split("@").first
logger.info("Syndicating to: #{mastodon_server}api/v1/statuses")
response = HTTParty.post("#{mastodon_server}api/v1/statuses", {
headers: {
"Idempotency-Key": key,