0
votes

Given a list of links to embedded streams, I would like to check that each stream is alive or dead:

The end goal is a system that does not display links which are broken so that TV website viewers do not waste time clicking on them.

The script would be written in PHP and would run on a daily basis via cron.

The script will be processing approximately 3000 urls at a time.

Can this feasibly be done in any manner?

What are some methods to do this?

Are you aware of any scripts in any language that do this?

Thanks you for taking time to respond or to provide any insites.

1
I'm not quite sure, if this is possible in PHP, but you could request the link (or stream) and wait a certain amount of time and then check how much data came back (similiar to a ping). If it's not enough to ensure the stream sent data, declare it as dead. - Johannes Klauß

1 Answers

0
votes

To check if link is dead or alive you can use sockets, curl, file_get_contents - anything, it depends, what kind of info you expect (is the link generally alive, does it gives code 200 instead of 404/503/etc, does page contains some specific data).

To run multiple requests simlutaneously, you may try forking your checking script, or just use some kind of queue server (like RabbitMQ, for example).