package Google::Voice;
use strict;
use warnings;
use Mojo::UserAgent;
use Mojo::JSON;
use IO::Socket::SSL 1.37;
use Google::Voice::Feed;
use Google::Voice::Call;
use Mojo::Base -base;
our $VERSIO
nd_sms {
my $self = shift;
my $c = $self->ua;
my ($phone, $content) = @_;
my $json = $c->post(
'https://www.google.com/voice/b/0/sms/send',
form => { id
_rnr_se => $self->rnr_se
}
)->res->json;
$@ = $json->{data}->{code} and return unless $json->{ok};
return $json->{ok};
}
for my $feed (
qw/ all starred spam trash
f->ua(shift);
return $self;
}
sub cancel {
my $self = shift;
my ($from, $to) = @_;
my $json = $self->ua->post(
'https://www.google.com/voice/call/cancel/' => form => {
forwardingN
',
_rnr_se => $self->rnr_se
}
)->res->json;
$@ = $json->{data}->{code} and return unless $json->{ok};
return $json->{ok};
}
1;
=head1 NAME
Google::Voice::Call
=head1 DES
y $json = $self->ua->post(
'https://www.google.com/voice/inbox/deleteMessages' => form => {
messages => $self->id,
trash => 1,
_rnr_se => $self->rnr_se
}
)->res->json;
$@ = $json->{data}->{code} and return unless $json->{ok};
return $json->{ok};
}
sub download {
my $self = shift;
my ($from, $to) = @_;
my $res = $self->ua->get(
'https://www.google.c