Skip to content

Instantly share code, notes, and snippets.

@Superbil
Forked from xatier/iTunes.pl
Created April 30, 2014 12:26
Show Gist options
  • Save Superbil/9e4c64c2d7662dac516e to your computer and use it in GitHub Desktop.
Save Superbil/9e4c64c2d7662dac516e to your computer and use it in GitHub Desktop.
Advance search in iTunes
#!/usr/bin/env perl
use 5.014;
use WWW::Mechanize;
use List::MoreUtils qw(uniq);
my $url = "http://search.itunes.apple.com/WebObjects/MZSearch.woa/wa/search?media=iTunesU&submit=media&term=e%20207";
my $mech = WWW::Mechanize->new();
$mech->add_header('User-agent' => 'iTunes/10.6.3.25');
$mech->get($url);
my $doc = $mech->content();
say "-"x50;
#
my @lines = split '\n', $doc;
for my $line (@lines) {
say $1 if $line =~ /anonymous-download-url=\"(.*?)\"/;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment