#! /usr/bin/perl # Autofetch Info my $store; my $coCode; my $appId; my $counter = 0; my $currentSoftware; my $temp; my $flag = 0; print "Content-type: text/html\n\n"; splitVars(); $currentSoftware = $appId; $store = 143441; fetchReviews(); sub splitVars{ my $item = ""; my $riz = $ENV{'QUERY_STRING'}; if($riz){ my @rizray = split("&", $riz); foreach $item (@rizray){ if(index($item, "id", 0) >= 0){ $appId = substr($item, index($item, "id", 0)+3, length($item)); } elsif(index($item, "country", 0) >= 0){ $coCode = substr($item, index($item, "country", 0) + 8, length($item)); } } } } sub fetchReviews() { my $doit = qq{curl -s -A "iTunes/4.2 (Macintosh; U; PPC Mac OS X 10.2" -H "X-Apple-Store-Front: $store-1" 'http://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=$currentSoftware'}; my $riz = `$doit`; my @rizray = split('\n', $riz); my @rizray = grep( / /, @rizray); foreach my $item (@rizray) { print "$item"; } }