summaryrefslogtreecommitdiff
path: root/lib/lsg_irc/link_plugin/github.ex
diff options
context:
space:
mode:
authorhref <href@random.sh>2020-07-25 17:41:12 +0200
committerhref <href@random.sh>2020-07-25 17:41:12 +0200
commitb8a36d46d687353921144a0b98cd804522b0d34f (patch)
treec8b25669ccbcd5c98ed6f4959def7fb1b5c6dc2f /lib/lsg_irc/link_plugin/github.ex
parentpouet (diff)
link: post_* callbacks; html & pdftitle.
Diffstat (limited to '')
-rw-r--r--lib/lsg_irc/link_plugin/github.ex5
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}} ->