Initial commit

This commit is contained in:
Andy Teijelo Pérez 2017-04-13 14:57:00 -04:00
commit 8bb3dc8fd6

23
daily.py Executable file
View file

@ -0,0 +1,23 @@
#!/usr/bin/env python3
import sys
import time
import json
import requests
import subprocess
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
date = time.localtime()
if len(sys.argv) > 1:
date = subprocess.check_output(['date','-d',sys.argv[1],'+%s'])
date = float(date)
date = time.localtime(date)
date = time.strftime(r'%Y-%m-%d', date)
url_template = 'https://jira.bloopark.com/rest/tempo-timesheets/3/worklogs?projectKey=PAS&dateFrom={}&dateTo={}&expand=issue.status'
resp = requests.get(url_template.format(date, date), verify=False)
print(json.dumps(resp.json()))