Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Net::Google::Spreadsheets::V4 からGoogle Sheet 更新
#!/usr/bin/env perl
use strict;
use warnings;
# https://twitter.com/sironekotoro/status/1316671830745214978?s=20
use utf8;
use Net::Google::Spreadsheets::V4;
my $CLIENT_ID = "";
my $CLIENT_SECRET = "";
my $REFRESH_TOKEN = "";
my $SPREADSHEET_ID = "";
my $gs = Net::Google::Spreadsheets::V4->new(
client_id => $CLIENT_ID,
client_secret => $CLIENT_SECRET,
refresh_token => $REFRESH_TOKEN,
spreadsheet_id => $SPREADSHEET_ID,
);
my ( $content, $res ) = $gs->request(
POST => ':batchUpdate',
{ requests => [
{ updateCells => {
start => {
sheetId => 0,
rowIndex => 0,
columnIndex => 0
},
rows => [
{ values => [
{ userEnteredValue => {
stringValue =>
'Perl入学式onlineは'
}
},
{ userEnteredValue => {
stringValue =>
'今週土曜日だよ!'
}
},
],
},
{ values => [
{ userEnteredValue => {
stringValue => '詳細はconnpassで'
}
},
{ userEnteredValue => {
stringValue =>
'Perl入学式onlineで検索!'
}
},
]
}
],
fields => "userEnteredValue"
}
},
]
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.