A
A
Anton Babilya2015-07-11 12:35:47
PHP
Anton Babilya, 2015-07-11 12:35:47

How to implement automatic scheduled posting in php?

Good day.
I ask you to tell me the most correct and correct way to implement the automatic execution of scheduled actions. On php.
I want to implement a service that will perform automatic posting to social networks.
Suppose there is a table `posts`, and in it the id of the instagram account where to post, picture, description, and time (Immediately the question is, in what format is it better to write, in standard, or UNIX?). And the cron goes, let's say it starts every minute, receives tasks, and goes to post them. But here we are faced with the problem that if there are not one task, but let's say 500. Let's say the processing of one task takes 3 seconds, in total it takes 25 minutes to complete them. How to speed it up, can the script handler run several times, and how can I divide tasks so that they are multi-threaded?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mr Freeman, 2015-07-11
@vladamir

php + curl + api + cron

D
Dmitry, 2015-07-11
@2fox

to implement "multi-threading" this script does not have to post itself.
he can simply call another script (including on another server) to which he can pass the task id.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question