mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
feat(scrapers/twitter): highest quality image url (#207)
This commit is contained in:
parent
886539c514
commit
3b2f5f36cb
1 changed files with 1 additions and 5 deletions
|
@ -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)
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue