NewsBlur/utils/archive/check_status.py

20 lines
363 B
Python
Raw Normal View History

2013-07-01 16:50:20 -07:00
import time
2024-04-24 09:50:42 -04:00
2013-07-01 16:50:20 -07:00
import requests
2024-04-24 09:43:56 -04:00
2013-07-01 16:50:20 -07:00
url = "http://www.newsblur.com"
while True:
start = time.time()
req = requests.get(url)
content = req.content
end = time.time()
2024-04-24 09:43:56 -04:00
print(
(
" ---> [%s] Retrieved %s bytes - %s %s"
% (str(end - start)[:4], len(content), req.status_code, req.reason)
)
)
2013-07-01 16:50:20 -07:00
time.sleep(5)