#!/usr/bin/perl -w
$myarchive=$ARGV[0];

$rightsection=0;

open RDF, "unzip -qc $myarchive |" or die "Can't read extension $myarchive :$!";

while(<RDF>) {
        #print;
        if (/urn\:mozilla\:install-manifest/i) {
                #print "found section\n";
                $rightsection=1;
        }
        if ( $rightsection ) {

        if (/em:id="([^"]+)"/) {
                print "$1\n";
                exit 0
        }
        if (/em:id>([^<]+)/) {
                print "$1\n";
                exit 0
        }

        }
}

exit 1

