From 37932ea4ad02a8332a7546b839c7af49bffba9fa Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Sun, 29 Jan 2023 13:31:51 +1100 Subject: [PATCH] Parse response from mastodon --- lib/adamantium/syndication/mastodon.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/adamantium/syndication/mastodon.rb b/lib/adamantium/syndication/mastodon.rb index b552095..e1d4189 100644 --- a/lib/adamantium/syndication/mastodon.rb +++ b/lib/adamantium/syndication/mastodon.rb @@ -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