Changeset View
Changeset View
Standalone View
Standalone View
lib/lsg_irc/link_plugin/imgur.ex
Context not available. | |||||
Needs to have a Imgur API key configured: | Needs to have a Imgur API key configured: | ||||
``` | ``` | ||||
config :lsg, :imgur, | config :nola, :imgur, | ||||
client_id: "xxxxxxxx", | client_id: "xxxxxxxx", | ||||
client_secret: "xxxxxxxxxxxxxxxxxxxx" | client_secret: "xxxxxxxxxxxxxxxxxxxx" | ||||
``` | ``` | ||||
Context not available. | |||||
end | end | ||||
def expand_imgur_image(image_id, opts) do | def expand_imgur_image(image_id, opts) do | ||||
client_id = Keyword.get(Application.get_env(:lsg, :imgur, []), :client_id, "42") | client_id = Keyword.get(Application.get_env(:nola, :imgur, []), :client_id, "42") | ||||
headers = [{"Authorization", "Client-ID #{client_id}"}] | headers = [{"Authorization", "Client-ID #{client_id}"}] | ||||
options = [] | options = [] | ||||
case HTTPoison.get("https://api.imgur.com/3/image/#{image_id}", headers, options) do | case HTTPoison.get("https://api.imgur.com/3/image/#{image_id}", headers, options) do | ||||
Context not available. | |||||
end | end | ||||
def expand_imgur_album(album_id, opts) do | def expand_imgur_album(album_id, opts) do | ||||
client_id = Keyword.get(Application.get_env(:lsg, :imgur, []), :client_id, "42") | client_id = Keyword.get(Application.get_env(:nola, :imgur, []), :client_id, "42") | ||||
headers = [{"Authorization", "Client-ID #{client_id}"}] | headers = [{"Authorization", "Client-ID #{client_id}"}] | ||||
options = [] | options = [] | ||||
case HTTPoison.get("https://api.imgur.com/3/album/#{album_id}", headers, options) do | case HTTPoison.get("https://api.imgur.com/3/album/#{album_id}", headers, options) do | ||||
Context not available. |