File php work alone automatically [closed]

1

I have a php file that sends information to:

http://air.radiotime.com/Playing.ashx?partnerId=PARTNERID&partnerKey=PARTNERKEY&id=ID&title=MUSICA&artist=ARTISTA

However, it only sends information when I reload the page, is there any way to make it automatic without my having to be on the site? That is, working alone.

    
asked by anonymous 13.01.2017 / 02:06

1 answer

0

You can run this PHP script from the command line. Just run the following command on the terminal:

php caminho/para/o/arquivo.php

Then you have 2 options, in this script create an infinite loop and let the file always run.

while (1==1) {
    // Codigo que faz a request
}

Or configure it in cron (or another task scheduler) to run this script in a certain time interval.

    
13.01.2017 / 12:31