Extract authors from feeds

This commit is contained in:
Shadowfacts 2021-09-03 17:09:16 -04:00
parent 5990d0e4c2
commit 162ba74dde
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
2 changed files with 6 additions and 2 deletions

View File

@ -3,10 +3,12 @@ defmodule Frenzy.Task.CreateItem do
use Task use Task
alias Frenzy.Repo alias Frenzy.Repo
@spec start_link(Frenzy.Feed.t(), FeedParser.Item.t()) :: {:ok, pid()}
def start_link(feed, entry) do def start_link(feed, entry) do
Task.start_link(__MODULE__, :run, [feed, entry]) Task.start_link(__MODULE__, :run, [feed, entry])
end end
@spec run(Frenzy.Feed.t(), FeedParser.Item.t()) :: :ok
def run(feed, entry) do def run(feed, entry) do
Logger.metadata(item_task_id: generate_task_id()) Logger.metadata(item_task_id: generate_task_id())
@ -31,7 +33,7 @@ defmodule Frenzy.Task.CreateItem do
title: entry.title, title: entry.title,
url: url, url: url,
date: date, date: date,
creator: "", creator: entry.creator,
content: entry.content, content: entry.content,
# we assume text/html in the feed itself, other stages may alter this # we assume text/html in the feed itself, other stages may alter this
content_type: "text/html" content_type: "text/html"
@ -91,6 +93,8 @@ defmodule Frenzy.Task.CreateItem do
Logger.error(changeset) Logger.error(changeset)
end end
end end
:ok
end end
defp get_real_url(entry) do defp get_real_url(entry) do

View File

@ -15,7 +15,7 @@
"ecto_sql": {:hex, :ecto_sql, "3.4.4", "d28bac2d420f708993baed522054870086fd45016a9d09bb2cd521b9c48d32ea", [:mix], [{:db_connection, "~> 2.2", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.4.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.3.0 or ~> 0.4.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.15.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.0", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "edb49af715dd72f213b66adfd0f668a43c17ed510b5d9ac7528569b23af57fe8"}, "ecto_sql": {:hex, :ecto_sql, "3.4.4", "d28bac2d420f708993baed522054870086fd45016a9d09bb2cd521b9c48d32ea", [:mix], [{:db_connection, "~> 2.2", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.4.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.3.0 or ~> 0.4.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.15.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.0", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "edb49af715dd72f213b66adfd0f668a43c17ed510b5d9ac7528569b23af57fe8"},
"elixir_make": {:hex, :elixir_make, "0.5.2", "96a28c79f5b8d34879cd95ebc04d2a0d678cfbbd3e74c43cb63a76adf0ee8054", [:mix], [], "hexpm", "382eeea8e02dfe6c468f6729b6cf20fe5b14390671d38c7363e59621c7ab4efc"}, "elixir_make": {:hex, :elixir_make, "0.5.2", "96a28c79f5b8d34879cd95ebc04d2a0d678cfbbd3e74c43cb63a76adf0ee8054", [:mix], [], "hexpm", "382eeea8e02dfe6c468f6729b6cf20fe5b14390671d38c7363e59621c7ab4efc"},
"erlex": {:hex, :erlex, "0.2.4", "23791959df45fe8f01f388c6f7eb733cc361668cbeedd801bf491c55a029917b", [:mix], [], "hexpm", "4a12ebc7cd8f24f2d0fce93d279fa34eb5068e0e885bb841d558c4d83c52c439"}, "erlex": {:hex, :erlex, "0.2.4", "23791959df45fe8f01f388c6f7eb733cc361668cbeedd801bf491c55a029917b", [:mix], [], "hexpm", "4a12ebc7cd8f24f2d0fce93d279fa34eb5068e0e885bb841d558c4d83c52c439"},
"feed_parser": {:git, "https://git.shadowfacts.net/shadowfacts/feed_parser.git", "b8de34c436855b453b1e4ced1fa3659c5a35ac95", [branch: "master"]}, "feed_parser": {:git, "https://git.shadowfacts.net/shadowfacts/feed_parser.git", "13394e38f6cf378e0e5789ea5b471d63d5b3794b", [branch: "master"]},
"file_system": {:hex, :file_system, "0.2.6", "fd4dc3af89b9ab1dc8ccbcc214a0e60c41f34be251d9307920748a14bf41f1d3", [:mix], [], "hexpm", "0d50da6b04c58e101a3793b1600f9a03b86e3a8057b192ac1766013d35706fa6"}, "file_system": {:hex, :file_system, "0.2.6", "fd4dc3af89b9ab1dc8ccbcc214a0e60c41f34be251d9307920748a14bf41f1d3", [:mix], [], "hexpm", "0d50da6b04c58e101a3793b1600f9a03b86e3a8057b192ac1766013d35706fa6"},
"floki": {:hex, :floki, "0.23.0", "956ab6dba828c96e732454809fb0bd8d43ce0979b75f34de6322e73d4c917829", [:mix], [{:html_entities, "~> 0.4.0", [hex: :html_entities, repo: "hexpm", optional: false]}], "hexpm", "e680b5ef0b61ce02faa7137db8d1714903a5552be4c89fb57293b8770e7f49c2"}, "floki": {:hex, :floki, "0.23.0", "956ab6dba828c96e732454809fb0bd8d43ce0979b75f34de6322e73d4c917829", [:mix], [{:html_entities, "~> 0.4.0", [hex: :html_entities, repo: "hexpm", optional: false]}], "hexpm", "e680b5ef0b61ce02faa7137db8d1714903a5552be4c89fb57293b8770e7f49c2"},
"gemini": {:git, "https://git.shadowfacts.net/shadowfacts/gemini-ex.git", "cc6f4e04374d163438faae1b12b54809bdfb7f4d", [branch: "main"]}, "gemini": {:git, "https://git.shadowfacts.net/shadowfacts/gemini-ex.git", "cc6f4e04374d163438faae1b12b54809bdfb7f4d", [branch: "main"]},