Here is the source:
Updated 1/22/13 3:14p
//
// main.m
// Pollhacky
//
// Created by Donald A Wittbrodt on 1/22/13.
// Copyright (c) 2013 Donnie Wittbrodt. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DLoad.h"
int main(int argc, const char * argv[])
{
@autoreleasepool {
DLoad *dl = [[DLoad alloc] init];
int numMillisecondsToDelay = 50;
NSLog(@"Press 1 then Enter to exit. Votes once every %d milliseconds to avoid invalid votes.", numMillisecondsToDelay);
dl.delayTimeInMilliseconds = numMillisecondsToDelay;
[NSThread detachNewThreadSelector:@selector(bruteVote) toTarget:dl withObject:nil];
int i=0;
while(1) {
//Check to see if user cancelled
scanf("%d", &i);
if(i == 1) {
//Tell the bruteVote to stop
dl.stillVoting = NO;
break;
}
//Give the main thread a small break to ease cpu usage
usleep(0.5);
}
[dl release];
}
return 0;
}
//
// DLoad.h
// Pollhacky
//
// Created by Donald A Wittbrodt on 1/22/13.
// Copyright (c) 2013 Donnie Wittbrodt. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface DLoad : NSObject <NSURLConnectionDelegate>
{
BOOL stillVoting;
int delayTimeInMilliseconds;
}
-(void)bruteVote;
@property BOOL stillVoting;
@property int delayTimeInMilliseconds;
@end
//
// DLoad.m
// Pollhacky
//
// Created by Donald A Wittbrodt on 1/22/13.
// Copyright (c) 2013 Donnie Wittbrodt. All rights reserved.
//
#import "DLoad.h"
@implementation DLoad
@synthesize stillVoting, delayTimeInMilliseconds;
-(id)init
{
self = [super init];
if(self) {
stillVoting = YES;
delayTimeInMilliseconds = 250;
}
return self;
}
-(void)bruteVote
{
while(stillVoting) {
//Find the poll id for the poll you want
NSString *pollID = @""; //Example: 6830128
//Find the answer id for the answer you want
NSString *answerID = @""; //Example: 31000396
NSURL *pollURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://polldaddy.com/poll/%@/", pollID]];
//Get the hmtl string to get the time and token fields
NSString *getStr = [NSString stringWithContentsOfURL:pollURL encoding:NSUTF8StringEncoding error:nil];
//Get the time
NSString *t = [[[[getStr componentsSeparatedByString:@","t":"] objectAtIndex:1] componentsSeparatedByString:@",""] objectAtIndex:0];
//Get the token
NSString *token = [[[getStr componentsSeparatedByString:@""n":""] objectAtIndex:1] substringWithRange:NSMakeRange(0, 32)];
NSString *fURLString = [NSString stringWithFormat:@"http://polldaddy.com/vote.php?va=10&pt=0&r=0&p=%@&a=%@%%2C&o=&t=%@&token=%@", pollID, answerID, t, token];
NSString *str = [NSString stringWithContentsOfURL:[NSURL URLWithString:fURLString] encoding:NSUTF8StringEncoding error:nil];
//NSLog(@"%@", str);
if([str rangeOfString:@"Thank you for voting!"].location != NSNotFound) {
NSLog(@"Voted!! :)");
}
else {
NSLog(@"Vote failed. :(");
}
//Sleep delayTimeInMilliseconds to give cpu a break
usleep(delayTimeInMilliseconds);
}
}
@end
I'm trying to run this and test the script, but I keep getting "signal SIGABRT" for this line:
ReplyDeleteNSString *t = [[[[getStr componentsSeparatedByString:@","t":"] objectAtIndex:1] componentsSeparatedByString:@",""] objectAtIndex:0];
Hmm. I just tested it on my end and everything still works fine. In debug mode put a breakpoint on this line, and print what getStr is at this time. Paste it here so I can see what's going on.
DeleteHmm maybe it's cause I'm doing something wrong. I have 3 files and then I ran it, but once it hits DLoad.h, it stops.
ReplyDeletehttp://i.imgur.com/5fFVNOm.jpg
so from there it seems fine, then I put a breakpoint after this line: http://i.imgur.com/UMeWfb6.jpg
DeleteOnce you hit that breakpoint, right click on getStr then click print so I can see what the result string is.
DeleteI uploaded it here:
Deletehttps://mega.co.nz/#!l90UVAJa!SAbT1hcXlfpLZD-NSJSgUTstS285zepEC7wA7EAijXU
Does that poll limit the number of votes the user can submit to 1?
DeleteYes. I thought this would allow bypass of the limit and batch vote.
DeleteWell the poll I wrote this for allowed multiple votes (within a time limit) and this simply automated the process and sped it up. You could probably make this work with your poll by finding out what the website checks to see if a user voted, maybe an IP address or a MAC address, and spoofing these with a new value each time a vote is submitted.
DeleteThis comment has been removed by the author.
ReplyDeleteHey there!
ReplyDeleteI'm trying to make it using php and curl, from what I read here we did it the same way, but I was just getting redirected, then I discovered it does need a cookie, so I saved the cookie together with the t and token values, and then send it when I call the vote.php, but now I get the message 'revoted', as if the vote was already counted... the poll has no limit, and I know thats something wrong because I just tested it on a new poll and it can't do a single vote.
Did you face a similar problem? Any idea how to solve or avoid it? Is your code still working nowdays?
Thank you!
hi there can I get code and the way to batch vote on Windows 7 ?
ReplyDeleteBest Casino Hotel Las Vegas | MapYRO
ReplyDeleteFind the best and newest casino hotels in 고양 출장안마 Las Vegas, NV. Hotel, reviews, 삼척 출장안마 ratings, amenities: expert 속초 출장샵 Las Vegas research, 거제 출장마사지 only at Hotel and 구리 출장샵 Travel Index.