Started creating a payload.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
var UrlHelper = require('./UrlHelper');
|
||||
|
||||
var currentTimestamp = require('./helpers/currentTimestamp');
|
||||
|
||||
class WakaTime {
|
||||
|
||||
detectionIntervalInSeconds = 60; //default
|
||||
@@ -44,7 +46,7 @@ class WakaTime {
|
||||
var data = {
|
||||
entity: domain,
|
||||
type: 'domain',
|
||||
time: Math.round((new Date()).getTime() / 1000),
|
||||
time: currentTimestamp(),
|
||||
is_debugging: false
|
||||
};
|
||||
|
||||
@@ -56,6 +58,15 @@ class WakaTime {
|
||||
console.log('sending entity with type url');
|
||||
|
||||
// Send entity in heartbeat
|
||||
|
||||
var data = {
|
||||
entity: entity,
|
||||
type: 'url',
|
||||
time: currentTimestamp(),
|
||||
is_debugging: false
|
||||
};
|
||||
|
||||
console.log(data);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
3
assets/js/helpers/currentTimestamp.js
Normal file
3
assets/js/helpers/currentTimestamp.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export default function(){
|
||||
return Math.round((new Date()).getTime() / 1000);
|
||||
}
|
||||
Reference in New Issue
Block a user