Update baraag.ex

This commit is contained in:
Chaska 2024-05-07 02:44:00 -05:00 committed by GitHub
parent cc944f795b
commit 3bdc9e04ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,19 +13,16 @@ defmodule Philomena.Scrapers.Baraag do
toot = Jason.decode!(body)
images =
Enum.map(toot["media_attachments"], fn p ->
%{
url: ["url"],
camo_url: Camo.Image.image_url(p["preview_url"])
}
end)
%{
source_url: toot["url"],
author_name: toot["account"]["username"],
description: toot["content"],
images: images
images: [
%{
url: "#{toot["media_attachments"]["url"]}",
camo_url: Camo.Image.image_url(toot["media_attachments"]["preview_url"])
}
]
}
end
end