Thank you for the guide. I wrote my own faucet and I am adding features to it every day. At the moment I am not breaking even but I have only one ad and I am carefully doing the maths before adding others.
I am interested in how bots can empty a faucet... do they really solve captchas or they use a captcha solving service? Do they switch ips and wallets?
here is the code i use to stop bots in the main index
//Checks that the username is not empty
if (!isset($_POST['username'])||$_POST['username']=="") {
$view['main']['result_html'] = '<div class="row text-center"><div class="col-sm-6 col-md-offset-3 bg-danger"><p>Missing email address!</p></div></div>';
$message = "Missing email address";
goto error;
}
$username = $_POST['username'];
//Checks if the user has written something in the captcha box
$captchaChallange = $_POST['adcopy_challenge'];
$captchaResponse = $_POST['adcopy_response'];
if (empty($captchaChallange) || empty($captchaResponse)) {
$view['main']['result_html'] = '<div class="row text-center"><div class="col-sm-6 col-md-offset-3 bg-danger"><p>Missing captcha, try again!</p></div></div>';
$message = "Missing captcha";
goto error;
}
$response = @file('http://verify.solvemedia.com/papi/verify?privatekey=' . $settings['solvemedia_verification_key'] . '&challenge=' . rawurlencode($captchaChallange) . '&response=' . rawurlencode($captchaResponse) . '&remoteip=' . $ip);
if (!isset($response[0]) || trim($response[0]) === 'false'){
$view['main']['result_html'] = '<div class="row text-center"><div class="col-sm-6 col-md-offset-3 bg-danger"><p>Wrong captcha!</p></div></div>';
$message = "Wrong captcha";
}
//We do not allow proxy here is what bots use !!!!
if(@fsockopen($_SERVER['REMOTE_ADDR'], 80, $errstr, $errno, 1))
{
$view['main']['result_html'] = '<div class="row text-center"><div class="col-sm-6 col-md-offset-3 bg-danger"><p>Bots Not Allowed !!</p></div></div>';
$message = "Proxy";
goto error;
}
$q = $sql->prepare("select * from users where LOWER(username) = LOWER(?) or ip = ? order by claimed_at desc");
$q->execute(array($username,$ip));
$row = $q->fetch();
//timer check
if ($row === null || $row['claimed_at'] <= $time - ($settings['timer'] * 60)) {
$amount = intval($rewards['random_reward']);
$response = pay($username,$amount,"Earnings from XXX, payed through Xapo!");
try{
$message=$response->message;
if(!$response->success){
$success = 0;
}
else{
$success = 1;
}