diff options
Diffstat (limited to '')
-rw-r--r-- | lib/lsg_irc/last_fm_plugin.ex | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/lsg_irc/last_fm_plugin.ex b/lib/lsg_irc/last_fm_plugin.ex index f29982c..03df675 100644 --- a/lib/lsg_irc/last_fm_plugin.ex +++ b/lib/lsg_irc/last_fm_plugin.ex @@ -124,7 +124,7 @@ defmodule Nola.IRC.LastFmPlugin do end defp now_playing(user) do - api = Application.get_env(:lsg, :lastfm)[:api_key] + api = Application.get_env(:nola, :lastfm)[:api_key] url = "http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&format=json&limit=1&extended=1" <> "&api_key=" <> api <> "&user="<> user case HTTPoison.get(url) do {:ok, %HTTPoison.Response{status_code: 200, body: body}} -> Jason.decode(body) @@ -136,7 +136,7 @@ defmodule Nola.IRC.LastFmPlugin do end end defp fetch_track(user, %{"recenttracks" => %{"track" => [ t = %{"name" => name, "artist" => %{"name" => artist}} | _]}}) do - api = Application.get_env(:lsg, :lastfm)[:api_key] + api = Application.get_env(:nola, :lastfm)[:api_key] url = "http://ws.audioscrobbler.com/2.0/?method=track.getInfo&format=json" <> "&api_key=" <> api <> "&username="<> user <> "&artist="<>URI.encode(artist)<>"&track="<>URI.encode(name) case HTTPoison.get(url) do {:ok, %HTTPoison.Response{status_code: 200, body: body}} -> |