audio_addict 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -3
- data/lib/audio_addict/api.rb +4 -4
- data/lib/audio_addict/commands/base.rb +4 -0
- data/lib/audio_addict/commands/config.rb +1 -0
- data/lib/audio_addict/commands/login.rb +2 -2
- data/lib/audio_addict/commands/playlist.rb +4 -0
- data/lib/audio_addict/commands/status.rb +3 -0
- data/lib/audio_addict/exceptions.rb +1 -0
- data/lib/audio_addict/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20084805bf5d4e9fa5409b4354364be364e005e8c5db251d4bc84dfa68f04436
|
4
|
+
data.tar.gz: 8011bab35c939ffd10c183b56e62d169259add2f6c7c042a4e60b29b9e1fa1ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d28c3632e64e82c2154c70366c6664c90f1cb9a9e84b3ef6082efcf0629cde1ab3003ee6985a048d2d21c5d699bf7a87ba15119e5ff4d8ec18a581d7e9dad7bc
|
7
|
+
data.tar.gz: f53f5dfeaabed9bb8d099809bae886f2b7b5cca0eb838e401f235257407cc9e8f7d386eab99d30577699b91f8110a7eda34126f059e3ea9b3a9d434fe0e8d775
|
data/README.md
CHANGED
@@ -14,12 +14,17 @@ radio network.
|
|
14
14
|
|
15
15
|
---
|
16
16
|
|
17
|
+
Demo
|
18
|
+
--------------------------------------------------
|
19
|
+
|
20
|
+
![Demo](https://raw.githubusercontent.com/DannyBen/audio_addict/master/demo/demo.gif)
|
21
|
+
|
17
22
|
|
18
23
|
Install
|
19
24
|
--------------------------------------------------
|
20
25
|
|
21
|
-
Please note that in order to use this gem you need to have
|
22
|
-
at one of the AudioAddict networks.
|
26
|
+
Please note that in order to use this gem you need to have an AUdioAddict
|
27
|
+
account (free or premium) at one of the AudioAddict networks.
|
23
28
|
|
24
29
|
```
|
25
30
|
$ gem install audio_addict
|
@@ -40,7 +45,7 @@ Features
|
|
40
45
|
- View currently playing track
|
41
46
|
- Vote on the currently playing track
|
42
47
|
- Save a log of a all your liked tracks
|
43
|
-
- Generate playlists
|
48
|
+
- Generate playlists (requires a premium account)
|
44
49
|
|
45
50
|
|
46
51
|
Usage
|
data/lib/audio_addict/api.rb
CHANGED
@@ -17,6 +17,8 @@ module AudioAddict
|
|
17
17
|
session = session(username, password)
|
18
18
|
Config.session_key = session['key']
|
19
19
|
Config.listen_key = session['member']['listen_key']
|
20
|
+
Config.email = session['member']['email']
|
21
|
+
Config.premium = session['member']['user_type'] == 'premium'
|
20
22
|
Config.save
|
21
23
|
end
|
22
24
|
|
@@ -42,10 +44,8 @@ module AudioAddict
|
|
42
44
|
|
43
45
|
def session(username, password)
|
44
46
|
params = { member_session: { username: username, password: password } }
|
45
|
-
|
46
|
-
|
47
|
-
response http.post "/#{network}/member_sessions", body: params
|
48
|
-
end
|
47
|
+
basic_auth
|
48
|
+
response http.post "/#{network}/member_sessions", body: params
|
49
49
|
end
|
50
50
|
|
51
51
|
def session_key
|
@@ -76,6 +76,7 @@ module AudioAddict
|
|
76
76
|
|
77
77
|
def key_guide
|
78
78
|
{
|
79
|
+
email: "Last email used for logging in.\nUsually set with !txtpur!radio login!txtrst!.",
|
79
80
|
session_key: "Used for authentication.\nUsually set with !txtpur!radio login!txtrst!.",
|
80
81
|
listen_key: "Used for generating playlists.\nUsually set with !txtpur!radio login!txtrst!.",
|
81
82
|
network: "Specify the AudioAddict network you are currently listening to.\nUsually set with !txtpur!radio set!txtrst!.",
|
@@ -12,7 +12,7 @@ module AudioAddict
|
|
12
12
|
proceed = true
|
13
13
|
|
14
14
|
if radio.api.logged_in?
|
15
|
-
say "!txtylw!You are already logged in"
|
15
|
+
say "!txtylw!You are already logged in as !undylw!#{Config.email}"
|
16
16
|
proceed = prompt.yes? "Login again?"
|
17
17
|
end
|
18
18
|
|
@@ -22,7 +22,7 @@ module AudioAddict
|
|
22
22
|
private
|
23
23
|
|
24
24
|
def login_prompt
|
25
|
-
user = prompt.ask "Username :"
|
25
|
+
user = prompt.ask "Username :", default: Config.email
|
26
26
|
pass = prompt.mask "Password :"
|
27
27
|
|
28
28
|
if user and pass
|
@@ -18,6 +18,8 @@ module AudioAddict
|
|
18
18
|
def init_command(args)
|
19
19
|
needs :network, :channel, :listen_key
|
20
20
|
|
21
|
+
require_premium_account
|
22
|
+
|
21
23
|
name = args['NAME']
|
22
24
|
outfile = "#{name}.yml"
|
23
25
|
|
@@ -33,6 +35,8 @@ module AudioAddict
|
|
33
35
|
def generate_command(args)
|
34
36
|
needs :network, :channel, :listen_key
|
35
37
|
|
38
|
+
require_premium_account
|
39
|
+
|
36
40
|
name = args['NAME']
|
37
41
|
|
38
42
|
infile = "#{name}.yml"
|
data/lib/audio_addict/version.rb
CHANGED