Subject: | module is not working fine and throwing errors |
While i am running this script, which is given on CPAN
#!/usr/bin/perl -w
use strict;
use WWW::Analytics::MultiTouch;
use Net::Google::Analytics::DataFeed;
my $username = 'sandeep@autoworldindia.com';
my $password = '********';
my $analytics_id = '*******';
#Simple, all-in-one approach
WWW::Analytics::MultiTouch->process(user => "$username",
pass => "$password",
id => "$analytics_id",
start_date => '2010-01-01',
end_date => '2010-02-01');
# Or step by step
my $mt = WWW::Analytics::MultiTouch->new(user => $username,
pass => $password,
id => $analytics_id);
$mt->get_data(start_date => '2012-01-01',
end_date => '2012-02-01');
$mt->summarise(window_length => 45);
$mt->report(filename => 'report-45day.xls');
$mt->summarise(window_length => 30);
$mt->report(filename => 'report-30day.xls');
It is giving error in both cases given in script.
while i comment second method it gives error like this.
Can't use string ("user") as a HASH ref while "strict refs" in use at
/usr/lib/perl5/site_perl/5.8.8/WWW/Analytics/MultiTouch.pm line 951.
while i comment first method it gives error like this.
Can't locate object method "data_feed" via package
"Net::Google::Analytics" at
/usr/lib/perl5/site_perl/5.8.8/WWW/Analytics/MultiTouch.pm line 95.
Please correct me if i am mistaken in code.
Thanks in advance.
Subject: | gapi.pl |
#!/usr/bin/perl -w
use strict;
use WWW::Analytics::MultiTouch;
use Net::Google::Analytics::DataFeed;
my $username = 'sandeep@autoworldindia.com';
my $password = '*********';
my $analytics_id = '*******';
#Simple, all-in-one approach
# WWW::Analytics::MultiTouch->process(user => "$username",
# pass => "$password",
# id => "$analytics_id",
# start_date => '2010-01-01',
# end_date => '2010-02-01');
# Or step by step
my $mt = WWW::Analytics::MultiTouch->new(user => $username,
pass => $password,
id => $analytics_id);
$mt->get_data(start_date => '2012-01-01',
end_date => '2012-02-01');
$mt->summarise(window_length => 45);
$mt->report(filename => 'report-45day.xls');
$mt->summarise(window_length => 30);
$mt->report(filename => 'report-30day.xls');