From 5ff1a16dab72560a74e394dfa142ee1299e6334f Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Sat, 4 Feb 2023 14:28:59 +1100 Subject: [PATCH] Hash access to photo keys --- 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 55b2018..4c76aa3 100644 --- a/lib/adamantium/syndication/mastodon.rb +++ b/lib/adamantium/syndication/mastodon.rb @@ -31,7 +31,7 @@ module Adamantium logger.info("Photos: #{post[:photos].inspect}") media_ids = post[:photos]&.map do |photo| file = Tempfile.new(SecureRandom.uuid) - file.write(URI.open(photo["value"]).read) + file.write(URI.open(photo[:value]).read) file.rewind response = HTTParty.post("#{mastodon_server}api/v2/media", { headers: { @@ -39,7 +39,7 @@ module Adamantium }, body: { file: file.read, - description: photo["alt"] + description: photo[:alt] } }) file.close