-
-
Save creaktive/4730357 to your computer and use it in GitHub Desktop.
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
perl -Mutf8::all -Mojo -E 'say$_->{name}for@{g("ws.spotify.com/search/1/album.json?q=Deep Purple")->json->{albums}}' |
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
p 'S$_->{name}for@{${jl get"http://ws.spotify.com/search/1/album.json?q=Deep Purple"}{albums}}' |
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