From c39538db1355259d97c08505516f122da4ee5d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferdinand=20M=C3=BCtsch?= Date: Thu, 21 Jan 2021 22:17:46 +0100 Subject: [PATCH] chore: include machine name in sample data script --- scripts/push_sample_data.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/push_sample_data.py b/scripts/push_sample_data.py index e82fb79..796d310 100644 --- a/scripts/push_sample_data.py +++ b/scripts/push_sample_data.py @@ -11,6 +11,7 @@ from typing import List, Union import requests from tqdm import tqdm +MACHINE = "devmachine" UA = 'wakatime/13.0.7 (Linux-4.15.0-91-generic-x86_64-with-glibc2.4) Python3.8.0.final.0 generator/1.42.1 generator-wakatime/4.0.0' LANGUAGES = { 'Go': 'go', @@ -75,7 +76,8 @@ def post_data_sync(data: List[Heartbeat], url: str, api_key: str): for h in tqdm(data): r = requests.post(url, json=[h.__dict__], headers={ 'User-Agent': UA, - 'Authorization': f'Basic {encoded_key}' + 'Authorization': f'Basic {encoded_key}', + 'X-Machine-Name': MACHINE, }) if r.status_code != 201: print(r.text)