All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
How to browse a web page periodically and check for certain sting
I want to monitor a web page or multiple ones for a certain keyword present in HTML. Actually I am doing this for a friend as she wants to order one item from a clothing website and it remains out of stock most of the time.
So, I want to make her a service/cron job that will monitor if the stock is available and send her alert.
I know I can do this in PHP using file_get_contents
but I was thinking if there is a better way to do it as the site may ban me if I check it very often and I think it cannot emulate browser very good. Or may be we can emulate browser using file_get_contents
.
Suggest me some better way. May be some browser library I can use in PHP that will open that page and read HTML?
Comments
Nodeping has this functionality, if you're willing to pay: https://nodeping.com/http_content_check.html
Or you can just check out that link to learn more about how it works, and then build your own version.
Hi ! I am using this opensource project that you can selfhost
https://github.com/dgtlmoon/changedetection.io
I went ahead and wrote the following very simple script. It checks for certain string in web page and is running fine for the past 3 days. As soon as that string is found, it will send WhatsApp message to her.
This is not complete code but just initial part of it which calls web page.
Ask chatgpt
I use visual ping free version, seems to work.