App-ggdrv

 view release on metacpan or  search on metacpan

lib/App/ggdrv/update.pm  view on Meta::CPAN

package App::ggdrv::update ; 
use strict ; 
use warnings ;
use feature 'say' ; 
use HTTP::Request::Common ;
use JSON qw[ encode_json ] ;
use LWP::UserAgent ;
use URI::QueryParam ;
use URI ;

my ($GOOGLE_DRIVE_UPLOAD_API , $gfile , $atoken ) ; 
return 1 ; 

sub update {
  $GOOGLE_DRIVE_UPLOAD_API = "https://www.googleapis.com/upload/drive/v3/files/";

lib/App/ggdrv/upload.pm  view on Meta::CPAN

package App::ggdrv::upload ;
use strict;
use warnings;
use feature 'say' ; 
use HTTP::Request::Common;
use JSON qw/encode_json decode_json/;
use LWP::UserAgent;
use Getopt::Std ; 
use Carp; 

my ($gfile , $atoken, $GOOGLE_DRIVE_UPLOAD_API , %o);
return 1 ;

sub upload { 
  getopts 'f:m:' , \%o ;

lib/App/ggdrv/upload.pm  view on Meta::CPAN


=encoding utf8

=head1

 $0  -f 目的のフォルダID ファイル名 [ファイル名] [ファイル名] ..

  指定したファイルを指定したGoogleドライブのフォルダにアップロードする。
  (同じ名前のファイルも複数回、このプログラムを実行すると、新規に次々とGoogleドライブにアップロードされる。少し要注意。)

  このプログラムは HTTP::Request::Common を用いていて、Net::Google::OAuthを使わない。

  オプション: 
    -f STR : 指定しないか、空文字だと、グーグル直下のディレクトリになる。
    -m TYPE : text/csv などを指定。 未指定なら text/plain ;


出力例: 

# 200
# {



( run in 0.351 second using v1.01-cache-2.11-cpan-de7293f3b23 )