Created
June 21, 2016 11:11
-
-
Save askvictor/00a135f957ee0a240d3988565f5bc68a to your computer and use it in GitHub Desktop.
This file contains 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; | |
my $data = search("radiohead"); | |
print "$data\n"; | |
print "$data->{song_hits}\n"; | |
print "$data->{song_hits}[0]\n"; | |
for my $hit (@{$data->{song_hits}}){ | |
print "$hit->{track}->{title}\n"; | |
} | |
use Inline Python => <<'END_OF_PYTHON_CODE'; | |
import gmusicapi | |
USERNAME="[email protected]" | |
PASSWORD="sooper_secr3t" | |
DEVICE_ID = "12345abcde123" # this can be obtained using https://raw.githubusercontent.com/squeezebox-googlemusic/squeezebox-googlemusic/master/mobile_devices.py | |
def search(needle): | |
c = gmusicapi.Mobileclient() | |
c.login(USERNAME, PASSWORD, DEVICE_ID) | |
r = c.search(needle, 2) | |
return r | |
END_OF_PYTHON_CODE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Produces output: