Started creating a payload.
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
var UrlHelper = require('./UrlHelper');
|
var UrlHelper = require('./UrlHelper');
|
||||||
|
|
||||||
|
var currentTimestamp = require('./helpers/currentTimestamp');
|
||||||
|
|
||||||
class WakaTime {
|
class WakaTime {
|
||||||
|
|
||||||
detectionIntervalInSeconds = 60; //default
|
detectionIntervalInSeconds = 60; //default
|
||||||
@@ -44,7 +46,7 @@ class WakaTime {
|
|||||||
var data = {
|
var data = {
|
||||||
entity: domain,
|
entity: domain,
|
||||||
type: 'domain',
|
type: 'domain',
|
||||||
time: Math.round((new Date()).getTime() / 1000),
|
time: currentTimestamp(),
|
||||||
is_debugging: false
|
is_debugging: false
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -56,6 +58,15 @@ class WakaTime {
|
|||||||
console.log('sending entity with type url');
|
console.log('sending entity with type url');
|
||||||
|
|
||||||
// Send entity in heartbeat
|
// 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);
|
||||||
|
}
|
||||||
@@ -83,6 +83,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|||||||
|
|
||||||
var UrlHelper = require('./UrlHelper');
|
var UrlHelper = require('./UrlHelper');
|
||||||
|
|
||||||
|
var currentTimestamp = require('./helpers/currentTimestamp');
|
||||||
|
|
||||||
var WakaTime = (function () {
|
var WakaTime = (function () {
|
||||||
function WakaTime() {
|
function WakaTime() {
|
||||||
_classCallCheck(this, WakaTime);
|
_classCallCheck(this, WakaTime);
|
||||||
@@ -133,7 +135,7 @@ var WakaTime = (function () {
|
|||||||
var data = {
|
var data = {
|
||||||
entity: domain,
|
entity: domain,
|
||||||
type: 'domain',
|
type: 'domain',
|
||||||
time: Math.round(new Date().getTime() / 1000),
|
time: currentTimestamp(),
|
||||||
is_debugging: false
|
is_debugging: false
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -142,6 +144,15 @@ var WakaTime = (function () {
|
|||||||
console.log('sending entity with type url');
|
console.log('sending entity with type url');
|
||||||
|
|
||||||
// Send entity in heartbeat
|
// Send entity in heartbeat
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
entity: entity,
|
||||||
|
type: 'url',
|
||||||
|
time: currentTimestamp(),
|
||||||
|
is_debugging: false
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -154,4 +165,17 @@ exports['default'] = WakaTime;
|
|||||||
module.exports = exports['default'];
|
module.exports = exports['default'];
|
||||||
//default
|
//default
|
||||||
|
|
||||||
},{"./UrlHelper":2}]},{},[1]);
|
},{"./UrlHelper":2,"./helpers/currentTimestamp":4}],4:[function(require,module,exports){
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
|
||||||
|
exports["default"] = function () {
|
||||||
|
return Math.round(new Date().getTime() / 1000);
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = exports["default"];
|
||||||
|
|
||||||
|
},{}]},{},[1]);
|
||||||
|
|||||||
Reference in New Issue
Block a user