diff options
author | href <href@random.sh> | 2020-07-25 17:41:12 +0200 |
---|---|---|
committer | href <href@random.sh> | 2020-07-25 17:41:12 +0200 |
commit | b8a36d46d687353921144a0b98cd804522b0d34f (patch) | |
tree | c8b25669ccbcd5c98ed6f4959def7fb1b5c6dc2f /lib/lsg_irc/link_plugin/github.ex | |
parent | pouet (diff) |
link: post_* callbacks; html & pdftitle.
Diffstat (limited to '')
-rw-r--r-- | lib/lsg_irc/link_plugin/github.ex | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/lsg_irc/link_plugin/github.ex b/lib/lsg_irc/link_plugin/github.ex index c7444c2..19be89b 100644 --- a/lib/lsg_irc/link_plugin/github.ex +++ b/lib/lsg_irc/link_plugin/github.ex @@ -1,6 +1,7 @@ defmodule LSG.IRC.LinkPlugin.Github do @behaviour LSG.IRC.LinkPlugin + @impl true def match(uri = %URI{host: "github.com", path: path}, _) do case String.split(path, "/") do ["", user, repo] -> @@ -12,6 +13,10 @@ defmodule LSG.IRC.LinkPlugin.Github do def match(_, _), do: false + @impl true + def post_match(_, _, _, _), do: false + + @impl true def expand(_uri, %{user: user, repo: repo}, _opts) do case HTTPoison.get("https://api.github.com/repos/#{user}/#{repo}") do {:ok, %HTTPoison.Response{status_code: 200, body: body}} -> |