Check if the computer is online. It does three tries:
Retrieve Apple's Captive Portal test page, see
Queries myip.opendns.com on OpenDNS, see
Retrieves icanhazip.com via HTTPS, see
If any of these are successful, it returns
is_online(timeout = 1)
Timeout for the queries. (Note: it is currently not used for the DNS query.)
TRUE Yes, online.
FALSE No, not online.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.