Blame | Last modification | View Log | RSS feed
#!/usr/bin/perluse strict;use Net::Google::Drive::Simple;#use Data::Dumper;#use Log::Log4perl qw(:easy);#Log::Log4perl->easy_init($DEBUG);#Log::Log4perl->easy_init($ERROR);my $gd = Net::Google::Drive::Simple->new();my $fileId = '1J-b8fKHcJti8yQrQcmmHlTA-ZV8_o0iLwN-BW6zB9Z8'; # Events.com shared fileidmy ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);my $date = sprintf ( "%04d%02d%02d", $year+1900,$mon+1,$mday);my $name = "files/RollerCon_MVP_Tickets.${date}.csv";my $file = 'https://docs.google.com/spreadsheets/export?id='.$fileId.'&exportFormat=csv';print "Today is $date.\n";print "Fetching the google sheet (csv)...\n";$gd->download( $file, $name ) or die "failed: $!";print "Uploading file to prod server...\n";system "/usr/bin/scp $name rollerco\@volunteers.rollercon.com:~/RCUtil/MVPTix/ 2>&1";