Search code examples
javascriptphpinstagramserverside-javascriptserver-side-scripting

Keeping a script running server side at all times


I have created a website: http://instapromobiz.com that automates Instagram likes/follows/unfollows via Instagrams api mainly using javascript and a little php.

My issue is that clearly it only runs while the user has the page open. This may be a broad question, but what would be the best way to have this script(which is an infinite loop until the user stops it) run without the user having the page open. Basically they log on, add tags and press start, then they can leave, then come back later and stop the script.

I have regular web hosting, no SSI or VPS, so node.js can't be used.


Solution

  • Rrestructure your script to terminate, and then use cron to run it every minute or every 15 min. Many web hosting plans will support this type of configuration.

    More info on Cron: https://help.ubuntu.com/community/CronHowto