diff options
| author | mo <mo.khan@gmail.com> | 2018-06-14 10:29:24 -0600 |
|---|---|---|
| committer | mo <mo.khan@gmail.com> | 2018-06-14 10:29:24 -0600 |
| commit | 80fd02e6113a23102dceaa94fa1d5a85c1e3a6e1 (patch) | |
| tree | 2c52a9d2b0c20874e1b99c1f001e905d0adcc3de /lib | |
| parent | f02b824205aae34585638cc78eefae434497eadd (diff) | |
display tracks for a user.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/ghetto/blaster/cli.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ghetto/blaster/cli.rb b/lib/ghetto/blaster/cli.rb index 2860498..3ce926b 100644 --- a/lib/ghetto/blaster/cli.rb +++ b/lib/ghetto/blaster/cli.rb @@ -16,6 +16,12 @@ module Ghetto say client.get(resolve(username)[:location]).body end + desc "tracks username", "fetch tracks for user" + def tracks(username) + user_id = resolve(username)[:location].split('?')[0].split('/').last + say client.get(build_uri("/users/#{user_id}/tracks?client_id=#{client_id}")).body + end + desc "version", "print version" def version say Ghetto::Blaster::VERSION |
