0

Is there any possibility of a PHP or any script that can be configured to Ping a URL after a specified interval of time automatically? I want to stay awake heroku app from sleeping, i m using hobby account 7$/month.

2
  • Do you have access to crontab?
    – Chris Lear
    May 25, 2017 at 11:19
  • No, its shared hosting. May 25, 2017 at 11:39

1 Answer 1

0

A quick dirty example..

<?php

while (true) // euuuuughh
{
    $throwAway = file_get_contents("http://www.google.com");
    sleep(10); // sleep for 10 seconds
}

?>

Hopefully you can take this and bend it to your needs.

You could also run this via command line and leave it running for a while to see if it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.