Skip to content

Commit

Permalink
feat(scrapers/twitter): highest quality image url (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdashlw authored Mar 14, 2024
1 parent 886539c commit 3b2f5f3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/philomena/scrapers/twitter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ defmodule Philomena.Scrapers.Twitter do
images =
Enum.map(json["tweet"]["media"]["photos"], fn p ->
%{
url: large_format(p["url"]),
url: "#{p["url"]}:orig",
camo_url: Camo.Image.image_url(p["url"])
}
end)
Expand All @@ -28,8 +28,4 @@ defmodule Philomena.Scrapers.Twitter do
images: images
}
end

defp large_format(str) do
String.replace_suffix(str, ".jpg", "?format=jpg&name=large")
end
end

0 comments on commit 3b2f5f3

Please sign in to comment.