Skip to content

Instantly share code, notes, and snippets.

@davorg
Created September 25, 2011 18:03
Show Gist options
  • Save davorg/1240907 to your computer and use it in GitHub Desktop.
Save davorg/1240907 to your computer and use it in GitHub Desktop.
This appears to be all you need to polljack a Daily Mail poll.
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use LWP::UserAgent;
$|++;
my $url = 'http://www.dailymail.co.uk/dwr/call/plaincall/AjaxPoll.vote.dwr';
my %form = (
callCount => 1,
page => '/news/article-2041265/BBC-turns-year-Our-Lord-2-000-years-Christianity-jettisoned-politically-correct-Common-Era.html',
httpSessionId => '',
scriptSessionId => '7975A59E0CAF39BC81A75CEF76ACF2DA920',
'c0-scriptName' => 'AjaxPoll',
'c0-methodName' => 'vote',
'c0-id' => 0,
'c0-param0' => 'string:1028567',
'c0-param1' => 'string:1030863',
'c0-param2' => 'string:',
batchId => 1,
);
my $resp;
my $ua = LWP::UserAgent->new;
foreach (1 .. 500) {
print "$_ ";
$resp = $ua->post($url, \%form);
sleep rand 5;
}
print Dumper $resp;
@davorg
Copy link
Author

davorg commented Sep 25, 2011

Not that I'd encourage anyone to do anything as dishonest as faking votes on an online poll.

@nickgrim
Copy link

You could probably just hardcode it to vote "No" and run it via cron.

@davorg
Copy link
Author

davorg commented Sep 25, 2011

That would, of course, be undemocratic :-/

But I notice that the percentages on the "Should we use BCE/CE instead of BC/AD?" poll have gone from 9%/91% to 24%/76% in the last hour or so. I wonder what they'll say in the morning whistles innocently

@nickgrim
Copy link

I was thinking of it more as "choosing sensible defaults". :-)

@davorg
Copy link
Author

davorg commented Sep 26, 2011

Oh, right. Yes. Except that in this case the right answer is "yes".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment