]> git.sesse.net Git - nms/blob - web/sendsms.pl
Merge.
[nms] / web / sendsms.pl
1 #!/usr/bin/perl
2 #
3
4 use HTTP::Cookies;
5 use LWP::UserAgent;
6 use Data::Dumper;
7 use strict;
8 use warnings;
9
10 my $uname = "eirikn";
11 my $pass = "removed";
12
13 my $ua = new LWP::UserAgent;
14 $ua->timeout(15);
15 $ua->agent('Mozilla/5.0');
16
17 #$ua->credentials( "http://zepo.tg07.gathering.org", "/", $uname, $pass );
18
19 my $content;
20 my %form;
21 $form{'userid'} = $uname;
22 $form{'next'} = "Look me up";
23
24 #my $content = $ua->get("http://zepo.tg07.gathering.org/");
25
26
27 $content = $ua->post("http://zepo.tg07.gathering.org/login", \%form);
28
29 if (!defined($content->{'_headers'}{'location'})) {
30         die "Could not find dudes";
31 }
32 $content->{'_headers'}{'set-cookie'} =~ /SID=(\w+);/;
33 my $sessioncookie = $1;
34 $content = $ua->get("https://partyticket.net/enter?dude_id=39457&got=it", "cookie" => "SID=".$sessioncookie.";");
35
36 $content->{'_headers'}{'set-cookie'} =~ /SID=(\w+);/;
37 $sessioncookie = $1;
38
39 print Dumper($content);
40
41 $form{'password'} = $pass;
42 $form{'userid'} = 39457;
43 $form{'next'} = "Log in";
44 $content = $ua->post("https://zepo.tg07.gathering.org/enter&got=it", "cookie" => "SID=".$sessioncookie, \%form);
45
46 print Dumper($content);
47
48
49
50
51 sub getpage {
52         my ($page) = @_;
53
54         
55 }