so i'm not very familiar with either javascript or php but what i want to do is create an automated voter for a certain site. its very simple. I have a url which increases the vote count by one. I have verified that entering this url counts as a vote. however the site cookie must be deleted before another vote can take place.This is what i have tried so far (ps: hoping to make this work in chrome. if anyone has an alternative browser to make it work in thats fine to.):
<html>
<body>
<script Type="text/javascript">
function clearCookies()
{
chrome.cookies.getAll({domain: "Domain.com"}, function(cookies) {
for(var i=0; i<cookies.length;i++) {
chrome.cookies.remove({url: "Domain.com" + cookies[i].path, name: cookies[i].name});
}
});
}
</script>
<?php
set_time_limit(0);
while(true){
echo "<script Type=\"text/javascript\"> clearCookies(); </script>";
$useragent="Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "Specific_URL_To_Vote");
curl_exec ($ch) ;
curl_close($ch);
sleep(6);
}
?>
</body>
</html>
so obviously i replace "Domain.com" with the actual domain and "Specific_URL_To_Vote" with the actual URL. can anyone help me with this? i've really only worked with java and basic html before so I'm not even entirely sure how I would troubleshoot this on my own.