Created
February 6, 2013 23:19
-
-
Save peczenyj/4726796 to your computer and use it in GitHub Desktop.
How to list all Deep Purple albuns from spotify using Perl ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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