Asking because 1) I saw a thread about same topic a few days ago, and 2) Twitter and LinkedIn are down for me now. HN works though. Pasting some test results in a comment below.
I checked (apart from trying to go to those sites in the browser, of course) using a slightly modified (only messages) version of this small Python program that I had written recently:
https://jugad2.blogspot.com/2018/03/checking-if-web-sites-ar...
A couple of results for Twitter and LinkedIn:
$ python is_site_online.py https://mobile.twitter.com https://linkedin.com
Checking if given sites are online or not:
https://mobile.twitter.com https://linkedin.com
------------------------------------------------------------
Checking https://mobile.twitter.com:
Error: Could not connect.
ConnectionError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",)
$ python is_site_online.py https://linkedin.com
Checking if given sites are online or not:
https://linkedin.com
------------------------------------------------------------
Checking https://linkedin.com:
Site: https://linkedin.com
Check with allow_redirects = False
Results:
r.ok: True
r.status_code: 301
request time: 5.797 secs
------------------------------------------------------------
Error: Exception: Exceeded 30 redirects.
Interesting thing is that last line above. Did not see it before when using this program.