mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 23:08:00 +01:00
17 lines
301 B
Elixir
17 lines
301 B
Elixir
|
defmodule PhilomenaWeb.Image.ScrapeController do
|
||
|
use PhilomenaWeb, :controller
|
||
|
|
||
|
alias Philomena.Scrapers
|
||
|
|
||
|
def create(conn, params) do
|
||
|
result =
|
||
|
params
|
||
|
|> Map.get("url")
|
||
|
|> to_string()
|
||
|
|> String.trim()
|
||
|
|> Scrapers.scrape!()
|
||
|
|
||
|
conn
|
||
|
|> json(result)
|
||
|
end
|
||
|
end
|