Hi,
to complete this project, please modify the script below so it works. Try it out with a test google account. The goal is to add new rows of data to a Google spreadsheet. The script is pretty self-explanatory and basic.
#!/usr/bin/perl
use Net::Google::Spreadsheets;
my $service = Net::Google::Spreadsheets->new(
username => '',
password => 'examplepassword'
);
# this assumes there's a Google spreadsheet called "mhdownloads", with a worksheet called "Sheet1" in it
my @spreadsheets = $service->spreadsheets();
my $spreadsheet = $service->spreadsheet(
{
title => 'mhdownloads'
}
);
my $worksheet = $spreadsheet->worksheet(
{
title => 'Sheet1'
}
);
my $table = $service->spreadsheet(
{
title => 'mhcontactinfo',
}
);
unless ($table) {
# create the table if it doesn't exist
my $table = $spreadsheet->add_table(
{
title => 'mhcontactinfo',
worksheet => $worksheet,
columns => ['First', 'Last', 'Mail', 'Comment'],
}
);
}
# add a record
my $record = $table->add_record(
{
First => 'Joe',
Last => 'Doe',
Mail => '',
Comments => 'How now brown cow?',
}
);
# and another record
my $record = $table->add_record(
{
First => 'Jane',
Last => 'Doe',
Mail => '',
Comments => 'Hello there.',
}
);
print "done";