Home >Backend Development >PHP Tutorial >How to synchronize lottery results

How to synchronize lottery results

WBOY
WBOYOriginal
2016-08-08 09:06:372283browse

I want to develop an application to know the lottery results
How should I obtain this result? Is it better to crawl data from other websites myself or use API?
How to synchronize the lottery time? For example, if there is a countdown timer and lottery draw How can we better implement the synchronized countdown? Thank you, Master

Reply content:

I want to develop an application to know the lottery results

How should I obtain this result? Is it better to crawl data from other websites myself or use API?
How to synchronize the lottery time? For example, if there is a countdown timer and lottery draw How can we better implement the synchronized countdown? Thank you, Master

You can directly set a process to run continuously to poll and capture data or call API. Of course, this is more troublesome.

The simple method is that when each user visits you make a judgment whether it is time to generate new data. If there is no data when the time is up, run the relevant function once to save the data into the database. Then there will be data in the database. After that, you don’t have to catch the users who come to visit. Of course, you also need to have a simple mechanism to remove duplicates.

As for whether to crawl or directly API, it doesn’t seem to be troublesome. You can check whether websites such as aggregated data have similar interfaces.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn