Skip to content

Instantly share code, notes, and snippets.

@peczenyj
Created February 6, 2013 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save peczenyj/4726796 to your computer and use it in GitHub Desktop.
Save peczenyj/4726796 to your computer and use it in GitHub Desktop.
How to list all Deep Purple albuns from spotify using Perl ?
use strict;
use warnings;
use English;
use JSON;
use LWP::Curl;
use URI::Escape;
use feature 'say';
use open qw<:std :utf8>;
my $search = "Deep Purple";
my $url = "http://ws.spotify.com/search/1/album.json?q=" . uri_escape($search);
my $object = decode_json(LWP::Curl->new->get($url));
say "Query: $search"; say "-" x 80;
say $ARG->{name} foreach @{$object->{"albums"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment