0

I did a little robot which get every 30 seconds a place temperature in JavaScript. This robot sends the results via slack every 5 minutes. In order to keep the robot running, I need to keep the page open on my navigator.

I thought If I put my JS app on a little webhost and make it run even if the page is closed could solve my problem, but no. How can I make it running on my webhost even if the page is closed?

Maybe is it possible if I change language, PHP? Any idea?

mplungjan
  • 169,008
  • 28
  • 173
  • 236
Matthieu
  • 225
  • 1
  • 3
  • 16
  • https://stackoverflow.com/questions/5398014/using-crontab-to-execute-script-every-minute-and-another-every-24-hours – mplungjan Oct 04 '18 at 11:56
  • PHP would work, or nodejs if you want to stick to JavaScript. You'll need to make it a service or use chron to execute it how ever often you want it run. – NickSlash Oct 04 '18 at 11:58
  • Ok, thank you, I just would like to be sure for PHP, before. – Matthieu Oct 04 '18 at 12:00
  • @NickSlash How can I loop every 30 seconds without any javascript, should I use sleep function ? – Matthieu Oct 04 '18 at 13:09

0 Answers0