2019-06-12 05:41:31 +00:00
|
|
|
'''
|
|
|
|
Perform a HEAD request and print the results.
|
|
|
|
'''
|
|
|
|
import sys
|
|
|
|
import json
|
|
|
|
import requests
|
|
|
|
|
2021-07-27 16:57:38 +00:00
|
|
|
from voussoirkit import pipeable
|
2019-06-12 05:41:31 +00:00
|
|
|
|
2021-07-27 16:57:38 +00:00
|
|
|
urls = pipeable.input(sys.argv[1], skip_blank=True, strip=True)
|
2019-06-12 05:41:31 +00:00
|
|
|
for url in urls:
|
|
|
|
page = requests.head(url)
|
|
|
|
headers = dict(page.headers)
|
|
|
|
headers = json.dumps(headers, indent=4, sort_keys=True)
|
|
|
|
print(page)
|
|
|
|
print(headers)
|