Created
October 17, 2018 22:12
-
-
Save olivertappin/380e20843004a2cde17904f2773e6a86 to your computer and use it in GitHub Desktop.
Automatically vote on a SurveyMonkey survey, and make it go your way.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Usage: Upload to a random server of your choice and send the URL to http://browsershots.org (or similar) | |
// Prerequisites: | |
// composer require fabpot/goutte | |
include 'vendor/autoload.php'; | |
use Goutte\Client; | |
$iterations = 1; | |
$defaultUserAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36'; | |
echo $userAgent . '<br>'; | |
echo $_SERVER['REMOTE_ADDR'] . '<br>'; | |
$client = new Client(); | |
$client->setHeader('user-agent', isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : $defaultUserAgent); | |
for ($i = 0; $i < $iterations; $i++) { | |
$crawler = $client->request('GET', 'https://www.surveymonkey.co.uk/r/ABCDEFG'); | |
$form = $crawler->selectButton('DONE')->form(); | |
$form['123456789'] = '123456789'; | |
$crawler = $client->submit($form); | |
$crawler->filter('.animated-header h1')->each(function ($node) { | |
echo $node->text() . '<br>'; | |
}); | |
$client->restart(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment