Parse response from mastodon

This commit is contained in:
2023-01-29 13:31:51 +11:00
parent 14a5cbeec0
commit 37932ea4ad

View File

@@ -15,7 +15,7 @@ module Adamantium
end
text = (post[:name] != "") ? post[:name] : post[:content]
text_with_link = "#{text}#{settings.micropub_site_url}"
text_with_link = "#{text}#{settings.micropub_site_url}/post/#{post[:slug]}"
tags = post[:category].map { |tag| "##{tag}" }.join(" ")
text_with_tags = "#{text_with_link} #{tags}"
@@ -36,7 +36,7 @@ module Adamantium
})
if response.code >= 200 && response.code < 300
status = response.body
status = JSON.parse(response.body, symbolize_names: true)
logger.info("Syndicated to Mastodon: #{response.body}")
Success("#{mastodon_server}/#{status[:id]}")
else