diff --git a/lib/adamantium/syndication/mastodon.rb b/lib/adamantium/syndication/mastodon.rb index 985e290..b552095 100644 --- a/lib/adamantium/syndication/mastodon.rb +++ b/lib/adamantium/syndication/mastodon.rb @@ -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,