Example #1
0
                        }
                    }
                    $results[] = $out;
                } else {
                    $results[] = $error;
                    if ($showErrors) {
                        echo $error . PHP_EOL;
                    }
                }
                curl_multi_remove_handle($mh, $ch);
                curl_close($ch);
            }
        } while ($running);
        curl_multi_close($mh);
        if ($loop) {
            $this->vote($id, $votes, $amount, $proxyList, $timeout);
            return array('results' => $results, 'votes' => $votes);
        }
        return array('results' => $results, 'votes' => $votes, 'total' => $amount);
    }
    public function makeCurl($url)
    {
        $cookie = dirname(__FILE__) . '/strawpoll.txt';
        $ch = curl_init($url);
        curl_setopt_array($ch, array(CURLOPT_FOLLOWLOCATION => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_COOKIEFILE => $cookie, CURLOPT_COOKIEJAR => $cookie));
        return $ch;
    }
}
$sp = new StrawPoll();
$votes = $sp->vote(4951212, array(1), 30, 'proxies.txt', 30, false);
echo 'Successfully voted ' . $votes['votes'] . '/' . $votes['total'] . ' time(s)';
Example #2
0
                        }
                    }
                    $results[] = $out;
                } else {
                    $results[] = $error;
                    if ($showErrors) {
                        echo $error . PHP_EOL;
                    }
                }
                curl_multi_remove_handle($mh, $ch);
                curl_close($ch);
            }
        } while ($running);
        curl_multi_close($mh);
        if ($loop) {
            $this->vote($id, -1, $vote, $proxyList, $timeout, $showErrors);
            return array('results' => $results, 'votes' => $votes);
        }
        return array('results' => $results, 'votes' => $votes, 'total' => $amount);
    }
    public function makeCurl($url)
    {
        $cookie = dirname(__FILE__) . '/strawpoll.txt';
        $ch = curl_init($url);
        curl_setopt_array($ch, array(CURLOPT_FOLLOWLOCATION => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_COOKIEFILE => $cookie, CURLOPT_COOKIEJAR => $cookie));
        return $ch;
    }
}
$sp = new StrawPoll();
$votes = $sp->vote($argv[1], -1, $argv[2], './proxies.txt', 8, false);
echo 'Successfully voted ' . $votes['votes'] . '/' . $votes['total'] . ' time(s)';
Example #3
-1
<?php

require_once 'inc/class.Strawpoll.php';
set_time_limit(0);
if ($argc < 3) {
    echo "Usage: php vote.php <VoteID> <Option> <Amount>\n";
} else {
    $id = $argv[1];
    $option = $argv[2] - 1;
    $amount = $argv[3];
    $sp = new StrawPoll();
    $votes = $sp->vote($id, $option, $amount, 'proxies.txt');
    echo 'Successfully voted ' . $votes['votes'] . '/' . $votes['total'] . ' time(s)' . "\n";
}