mirror of
https://github.com/wakatime/sublime-wakatime.git
synced 2023-08-10 21:13:02 +03:00
use api subdomain for fetching summaries
This commit is contained in:
parent
07513d8f10
commit
c54e575210
@ -138,6 +138,7 @@ PYTHON_LOCATION = None
|
|||||||
HEARTBEATS = queue.Queue()
|
HEARTBEATS = queue.Queue()
|
||||||
HEARTBEAT_FREQUENCY = 2 # minutes between logging heartbeat when editing same file
|
HEARTBEAT_FREQUENCY = 2 # minutes between logging heartbeat when editing same file
|
||||||
SEND_BUFFER_SECONDS = 30 # seconds between sending buffered heartbeats to API
|
SEND_BUFFER_SECONDS = 30 # seconds between sending buffered heartbeats to API
|
||||||
|
API_SUMMARIES_URL = 'https://api.wakatime.com/api/v1/users/current/summaries?start=today&end=today&api_key={}'
|
||||||
|
|
||||||
|
|
||||||
# Log Levels
|
# Log Levels
|
||||||
@ -238,7 +239,7 @@ class FetchStatusBarCodingTime(threading.Thread):
|
|||||||
log(DEBUG, 'Missing WakaTime API key.')
|
log(DEBUG, 'Missing WakaTime API key.')
|
||||||
return
|
return
|
||||||
|
|
||||||
url = 'https://wakatime.com/api/v1/users/current/summaries?start=today&end=today&api_key={}'.format(self.api_key)
|
url = API_SUMMARIES_URL.format(self.api_key)
|
||||||
try:
|
try:
|
||||||
with closing(urllib2.urlopen(url)) as response:
|
with closing(urllib2.urlopen(url)) as response:
|
||||||
grand_total_text = json.loads(u(response.read()))['data'][0]['grand_total']['text']
|
grand_total_text = json.loads(u(response.read()))['data'][0]['grand_total']['text']
|
||||||
|
Loading…
Reference in New Issue
Block a user