| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
#!/usr/bin/perl -w |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
#Automagically generated from SMSSplitter scripts |
|
4
|
|
|
|
|
|
|
#Credits goes to Aleph0 Edition! http://www.aleph0.f2s.com for the original |
|
5
|
|
|
|
|
|
|
#implementation as a SMSsplitter script |
|
6
|
|
|
|
|
|
|
#Simply reimplemented by Giulio Motta |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package WWW::SMS::Vizzavi; |
|
9
|
1
|
|
|
1
|
|
669
|
use Telephone::Number; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
175
|
|
|
10
|
|
|
|
|
|
|
require Exporter; |
|
11
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
|
12
|
|
|
|
|
|
|
@EXPORT = qw(); |
|
13
|
|
|
|
|
|
|
@EXPORT_OK = qw(@PREFIXES _send MAXLENGTH); |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
@PREFIXES = (Telephone::Number->new('39', [ |
|
16
|
|
|
|
|
|
|
qw(333 335 338 339 340 347 348 349 328 329 380 388 389) |
|
17
|
|
|
|
|
|
|
], undef) |
|
18
|
|
|
|
|
|
|
); |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$VERSION = '1.01'; |
|
21
|
|
|
|
|
|
|
sub MAXLENGTH () {140} |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub hnd_error { |
|
24
|
0
|
|
|
0
|
0
|
|
$_ = shift; |
|
25
|
0
|
|
|
|
|
|
$WWW::SMS::Error = "Failed at step $_ of module Vizzavi.pm\n"; |
|
26
|
0
|
|
|
|
|
|
return 0; |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub _send { |
|
30
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
31
|
|
|
|
|
|
|
|
|
32
|
1
|
|
|
1
|
|
5
|
use HTTP::Request::Common qw(GET POST); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
53
|
|
|
33
|
1
|
|
|
1
|
|
5
|
use HTTP::Cookies; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
24
|
|
|
34
|
1
|
|
|
1
|
|
11
|
use LWP::UserAgent; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
259
|
|
|
35
|
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
$ua = LWP::UserAgent->new; |
|
37
|
0
|
|
|
|
|
|
$ua->agent('Mozilla/5.0'); |
|
38
|
0
|
0
|
|
|
|
|
$ua->proxy('http', $self->{proxy}) if ($self->{proxy}); |
|
39
|
0
|
|
|
|
|
|
$ua->cookie_jar(HTTP::Cookies->new( |
|
40
|
|
|
|
|
|
|
file => $self->{cookie_jar}, |
|
41
|
|
|
|
|
|
|
autosave => 1 |
|
42
|
|
|
|
|
|
|
) |
|
43
|
|
|
|
|
|
|
); |
|
44
|
|
|
|
|
|
|
|
|
45
|
0
|
0
|
|
|
|
|
$self->{smstext} = substr($self->{smstext}, 0, MAXLENGTH - 1) |
|
46
|
|
|
|
|
|
|
if (length($self->{smstext})>MAXLENGTH); |
|
47
|
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
$req = POST 'http://sms.vizzavi.it/global.asp', |
|
49
|
|
|
|
|
|
|
[ |
|
50
|
|
|
|
|
|
|
'txtMsg' => $self->{smstext} ,'selPref' => $self->{prefix}, |
|
51
|
|
|
|
|
|
|
'TypeOpen' => '1' ,'txtTel' => $self->{telnum} , |
|
52
|
|
|
|
|
|
|
'Counter' => '' |
|
53
|
|
|
|
|
|
|
]; |
|
54
|
0
|
|
|
|
|
|
$req->headers->referer('http://sms.vizzavi.it/freesms_conf.asp'); |
|
55
|
0
|
|
|
|
|
|
my $step = 1; |
|
56
|
0
|
|
|
|
|
|
$file = $ua->simple_request($req)->as_string; |
|
57
|
0
|
0
|
|
|
|
|
return &hnd_error($step) unless ($file =~ m'Messaggio\+accodato\+con\+successo's); |
|
58
|
0
|
|
|
|
|
|
$ua->cookie_jar->clear('sms.vizzavi.it'); |
|
59
|
0
|
|
|
|
|
|
1; |
|
60
|
|
|
|
|
|
|
} |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |