#! /usr/bin/perl -w use LWP::Simple; use strict; # ToDo #print "To Do Reviews:\n"; my $currentSoftware ='321234472'; my $country ="\nCOUNTRY: United States"; my $store ='143441'; getAllReviewstest($country,$store,$currentSoftware); sub getAllReviewstest() { #print $country, "\n"; print "Content-Type: text/html\n\n"; my $review=fetchReviews(@_); print < Reviews $review EOT } sub getAllReviews() { my ($country,$store,$currentSoftware)=@_; print $country, "\n"; print fetchReviews($store,$currentSoftware); } sub fetchReviews() { my ($store,$currentSoftware)=@_; # 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&mt=8' | gunzip | xmllint --format -}; # my $doit = qq{curl -s 'http://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=$currentSoftware&mt=8'}; # my $riz = `$doit`; # "get" stammt von "LWP::Simple"; my $riz=get("http://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=$currentSoftware&mt=8"); my @rizray = split('\n', $riz); # "|" bedutet "oder" in regulären Ausdrücken @rizray = grep(!/string|key|dict|VBoxView|HBoxView|MatrixView|TextView|iTunes|LoadFrameURL|PathElement|Protocol|ScrollView|Category.*|Color|Released.*|Seller.*|Rated.*|Rate this.*|©.*|.*MB|Version.*|.*2009|Infrequent.*|NEW.*|LANGUAGES.*|REQUIREMENTS.*|Apple.*|All rights.*|Policy.*|Terms of.*|Compatible.*|Requires.*|English.*|normalStyle|GotoURL|Sort by:|by.*|Copyright|> \/<|>..\s*\S+\s*\s*-\s*-!!gs; return $review; }