aboutsummaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rw-r--r--main.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.py b/main.py
index d601c6b..88bb81f 100644
--- a/main.py
+++ b/main.py
@@ -20,6 +20,10 @@ SORT_KV = {
"distance": "distance",
}
+HEADERS = {
+ "User-Agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/533.45 (KHTML, like Gecko) Chrome/48.0.2094.221 Safari/602"
+}
+
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser()
@@ -40,7 +44,7 @@ def get_location(address: str) -> tuple[float, float]:
def get_latest_data() -> Tuple[pd.DataFrame, str]:
try:
- response = requests.get(ENDPOINT)
+ response = requests.get(ENDPOINT, headers=HEADERS, timeout=10)
response.raise_for_status()
except Exception as e:
raise e
git.ajschof.me — hosted by ajschofield — powered by cgit