Hash access to photo keys
This commit is contained in:
@@ -31,7 +31,7 @@ module Adamantium
|
|||||||
logger.info("Photos: #{post[:photos].inspect}")
|
logger.info("Photos: #{post[:photos].inspect}")
|
||||||
media_ids = post[:photos]&.map do |photo|
|
media_ids = post[:photos]&.map do |photo|
|
||||||
file = Tempfile.new(SecureRandom.uuid)
|
file = Tempfile.new(SecureRandom.uuid)
|
||||||
file.write(URI.open(photo["value"]).read)
|
file.write(URI.open(photo[:value]).read)
|
||||||
file.rewind
|
file.rewind
|
||||||
response = HTTParty.post("#{mastodon_server}api/v2/media", {
|
response = HTTParty.post("#{mastodon_server}api/v2/media", {
|
||||||
headers: {
|
headers: {
|
||||||
@@ -39,7 +39,7 @@ module Adamantium
|
|||||||
},
|
},
|
||||||
body: {
|
body: {
|
||||||
file: file.read,
|
file: file.read,
|
||||||
description: photo["alt"]
|
description: photo[:alt]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
file.close
|
file.close
|
||||||
|
Reference in New Issue
Block a user