summaryrefslogtreecommitdiff
path: root/lib/lsg_irc/last_fm_plugin.ex
diff options
context:
space:
mode:
authorJordan Bracco <href@random.sh>2022-12-17 14:01:18 +0000
committerJordan Bracco <href@random.sh>2022-12-20 19:29:41 +0100
commit67754dc5366976b0f4300af2d1798baa81423df5 (patch)
treeea7d78652e52e8e347f1976c4b2777cd6565462f /lib/lsg_irc/last_fm_plugin.ex
parentNola rename cont. pt. 2. Refs T77. (diff)
Nola rename, cont. pt. 3. Refs T77.
`s/:lsg/:nola/g`
Diffstat (limited to 'lib/lsg_irc/last_fm_plugin.ex')
-rw-r--r--lib/lsg_irc/last_fm_plugin.ex4
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}} ->