#!/usr/bin/perl # Author: Olivier HO-A-CHUCK # Date: Juen 18th 2013 # License: Do What You Want with it! Just comes with no garantie. use HTML::TableExtract; sub trim; sub removeBR; local $/; open(FILE, 'iTunesConnect.html') or die "Can't read file 'filename' [$!]\n"; $document = ; close (FILE); $document = removeBR($document); # Quick and dirty trick for apps with 2 status (like ready for sales and In Review). $te = HTML::TableExtract->new( headers => [qw(AppName AppType Version Status AppleID LastModified)] ); $te->parse($document); my $string = "App Name;App Type;Version;Status;Apple ID;Last Modified\n"; # Examine all matching tables foreach $ts ($te->tables) { foreach $row ($ts->rows) { $string = $string . trim(@$row[0]) . ";" . trim(@$row[1]) . ";" . trim(@$row[2]) . ";" . trim(@$row[3]) . ";" . trim(@$row[4]) . ";" . trim(@$row[5]) . "\n"; } } print $string; # Perl trim function to remove whitespace from the start and end of the string sub trim { my $string = shift; $string =~ s/^\s+//; $string =~ s/\s+$//; return $string; } sub removeBR { my $string = shift; $string =~ s/
.*//g; return $string; }