Skip to content

Instantly share code, notes, and snippets.

@creaktive
Forked from peczenyj/deep.purple.pl
Last active December 12, 2015 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save creaktive/4730357 to your computer and use it in GitHub Desktop.
Save creaktive/4730357 to your computer and use it in GitHub Desktop.
perl -Mutf8::all -Mojo -E 'say$_->{name}for@{g("ws.spotify.com/search/1/album.json?q=Deep Purple")->json->{albums}}'
p 'S$_->{name}for@{${jl get"http://ws.spotify.com/search/1/album.json?q=Deep Purple"}{albums}}'
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