This module is actually the simplest one I've found to access Google Drive, yet providing almost all I need... except, for what I can see, a method for sharing a file.
I tried something like this, and it works for my need; it would be better, though, having this as a native feature (possibly with a better, more robust implementation than mine):
package Net::Google::Drive::Simple;
sub file_share {
my( $self, $file_id ) = @_;
my $url = URI->new( $self->{ api_file_url } . '/' . $file_id . '/permissions' );
my $data = $self->http_json( $url, {
file_id => $file_id,
type => 'anyone',
role => 'reader',
withLink => 'true'
} );
if( ! defined $data ) {
return undef;
}
my $metadata = $self->file_metadata($file_id);
return $metadata->{webContentLink};
This module is actually the simplest one I've found to access Google Drive, yet providing almost all I need... except, for what I can see, a method for sharing a file.
I tried something like this, and it works for my need; it would be better, though, having this as a native feature (possibly with a better, more robust implementation than mine):
package Net::Google::Drive::Simple;
sub file_share {
}