Skip to content

Instantly share code, notes, and snippets.

@ezfe
Created August 10, 2014 03:12
Show Gist options
  • Save ezfe/5ba65bc3f0ce12997b17 to your computer and use it in GitHub Desktop.
Save ezfe/5ba65bc3f0ce12997b17 to your computer and use it in GitHub Desktop.
<?php
$new = 0;
while ($new < 5) {
$tokenFinder = file_get_contents('http://www.campconiston.org/photos/displayimage.php?album=lastup&cat=0&pid=7577');
preg_match_all('/"form_token":"([a-z0-9]+)"/', $tokenFinder, $token);
preg_match_all('/"timestamp":([0-9]+)/', $tokenFinder, $timestamp);
$result = file_get_contents('http://www.campconiston.org/photos/ratepic.php?rate=5&pic=7577&timestamp=' . $timestamp[1][0] . '&form_token=' . $token[1][0]);
$new = json_decode($result, true)['new_rating'];
}
echo $new;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment