Skip to content

Instantly share code, notes, and snippets.

@hothero
Created May 15, 2013 13:36
Show Gist options
  • Save hothero/5584038 to your computer and use it in GitHub Desktop.
Save hothero/5584038 to your computer and use it in GitHub Desktop.
get webpage content for waking up heroku server
<?php
$urls = array("http://webcontest.mirlab.org", "http://webprogramming.mirlab.org");
for ($i=0; $i<count($urls); $i++)
{
getContent($urls[$i]);
}
function getContent($url)
{
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, false);
$data = curl_exec($curl);
curl_close($curl);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment