Action Scheduler to Hit External PHP File

Hi - my lack of Wappler knowledge is probably hurting me here.

I’m using the Action Scheduler to refresh my database every five seconds. That works great.

But how can I use the Action Scheduler to load an external PHP file?

I need it to say…
Every 5 seconds load “/GetTheText.php” which will grab some emails from an IMAP server and put them in a database.

Then my Action Scheduler will refresh my database view. But, how can it hit that external page?

THANKS!
Jeff

Here’s a couple of forums with answers.
This one suggests addressing it to curl

https://community.wappler.io/t/invoke-server-action-from-cron-job/14516/5

I’ve run CRON jobs where the php file was called from one server across domains to another server which contained the script that would update a database table.

Of course, that page had to be protected by a username and password.

Cron <wp12516289@vwp3740> /is/htdocs/wp12263389_VXR92NWLJ9/www/mytargetwebsite.de/sql-update-database.sh

the CRON file on the first server sat in the folder structure outside the public html folders as this example:

**/bin/sh**: 
/is/htdocs/wp12263389_VXR92NWLJ9/www/mytargetwebsite.de/sql-update-database.sh
``

Here’s a pretty comprehensive summary of useful crontab commands:

https://www.hostinger.com/tutorials/cron-job

The problem with CRON jobs is that they have to be scheduled, and usually scheduled manually… right?

I do not know when this script will be loaded by end users.

I have a server action which looks for certain conditions in the database regarding payment reminder messages that need to be sent. I then run that SA from a cron an once an hour.

If you can write a SA to detect your condition then you could do the same thing…

Unless I’m missing something? :thinking:

This is a site that let’s speakers/preachers (like myself) take questions from the audience via text message or email.

  1. An audience member sends in an email.
  2. A script running, every 7 seconds of so, checks the IMAP and takes out the email, parses it, and puts the relevant data in a database.
  3. The speaker’s screen shows a list of questions (properly formatted, not big emails). If he clicks on one then it gets sent to a public screen.

So, whenever a speaker loads up his screen the whole process needs to start running and hit that IMAP every 7 seconds.

You could add an API component to the page (client-side) and then use an action scheduler to run it every X seconds.