I was wondering how I could go about making a progress bar for parsing HTML data. Essentially the user searches something and I parse another website. I tried doing it with getting the amount of objects found in an array then dividing 100 by it, and getting the current one in a for loop and multiplying it by 100/total. Then I would update a text file with the value. Then update the progress bar with that value. However, I want a more efficient way to do it. Also it has to be unique to each user. Thanks.
I found another way to do it, this is to help all of those people that have the same question. I found it out on here http://w3shaman.com/article/php-progress-bar-script
Executing length php process while showing progress, even having multiple progress bars on same page and pre/post hooks: http://pastebin.com/KSxjC01r
I've done it for myself, because I need it.
Feel free to use it.
If you use PHP for the parsing part then this means that you should somehow get information from that process. This also means that you have to (probably) make ajax requests to another php script which monitors the first one or at least gets some log information from it. I don't think that PHP is the right choice for that. I'll suggest to use nodejs. There, you are able to implement real time socket communication, which is kinda easy.
©2020 All rights reserved.