mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-03-31 00:37:45 +02:00
adding title parsing!
This commit is contained in:
parent
f8b083f64a
commit
2cd8830191
2 changed files with 6 additions and 2 deletions
|
@ -29,6 +29,8 @@ defmodule Philomena.Scrapers.Furaffinity do
|
||||||
|> String.replace(~r/\n /, "\n")
|
|> String.replace(~r/\n /, "\n")
|
||||||
|> String.trim()
|
|> String.trim()
|
||||||
|
|
||||||
|
description = "##\s#{submission["title"]}\n#{description}"
|
||||||
|
|
||||||
%{
|
%{
|
||||||
source_url: url,
|
source_url: url,
|
||||||
author_name: submission["name"],
|
author_name: submission["name"],
|
||||||
|
|
|
@ -17,18 +17,20 @@ defmodule Philomena.Scrapers.Inkbunny do
|
||||||
json = Jason.decode!(body)
|
json = Jason.decode!(body)
|
||||||
[submission] = json["submissions"]
|
[submission] = json["submissions"]
|
||||||
|
|
||||||
|
description = "##\s#{submission["title"]}\n#{submission["description"]}"
|
||||||
|
|
||||||
images =
|
images =
|
||||||
for x <- submission["files"] do
|
for x <- submission["files"] do
|
||||||
%{
|
%{
|
||||||
url: "#{x["file_url_full"]}",
|
url: "#{x["file_url_full"]}",
|
||||||
camo_url: Camo.Image.image_url(x["file_url_preview"])
|
camo_url: Camo.Image.image_url(x["file_url_screen"])
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
%{
|
%{
|
||||||
source_url: url,
|
source_url: url,
|
||||||
author_name: submission["username"],
|
author_name: submission["username"],
|
||||||
description: submission["description"],
|
description: description,
|
||||||
images: images
|
images: images
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue