-
Notifications
You must be signed in to change notification settings - Fork 0
/
craigslist-flag
executable file
·41 lines (31 loc) · 1.06 KB
/
craigslist-flag
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env perl
use strict;
use LWP::UserAgent;
my $post = shift(@ARGV) or die("Please pass the posting ID from Craigslist!");
my @proxies = (7070,8080);
my $ua = LWP::UserAgent->new;
$ua->agent('Mozilla/4.0 (compatible ; MSIE 6.0; Windows NT 5.1)');
$ua->timeout(10);
#$ua->env_proxy;
#$ua->proxy([qw(http https)] => 'socks://172.16.30.2:7070');
my $response = $ua->get("http://stlouis.craigslist.org/flag/?flagCode=16&postingID=$post");
# my $response = $ua->get("http://www.whatismyip.com");
if ($response->is_success) {
# print $response->content; # or whatever
print "Flagged locally.\n";
}
else {
die $response->status_line;
}
foreach my $port(@proxies){
$ua->proxy([qw(http https)] => "socks://172.16.30.2:$port");
my $response = $ua->get("http://stlouis.craigslist.org/flag/?flagCode=16&postingID=$post");
# my $response = $ua->get("http://www.whatismyip.com");
if ($response->is_success) {
# print $response->content; # or whatever
print "Flagged on port $port.\n";
}
else {
die $response->status_line;
}
}