var dt = new Date();
var y = dt.getFullYear();
var m = toNiketa(dt.getMonth() + 1);
var d = toNiketa(dt.getDate());
var H = toNiketa(dt.getHours());
var M = toNiketa(dt.getMinutes());
var S = toNiketa(dt.getSeconds());
function toNiketa(v) { return v < 10 ? '0' + v : v }
var ts = y + m + d + H + M + S;
var epurl = 'http://****.sakura.ne.jp/test/loguru.cgi?c=' + ts + ',' + properties.val;
ajax({
url: epurl,
type: 'get',
timeout: 5000,
success: function(contents) {
callbackSuccess({
resultType: 'continue',
});
},
error: function(request, errorMessage) {
log('ERROR: ' + errorMessage);
callbackSuccess({
resultType: 'continue',
});
}
});
return {
resultType: 'pause'
};
#!/usr/bin/env perl
use strict;
use warnings;
use CGI;
my $LOG_FILE = 'log.txt';
my $q = new CGI;
print $q->header(-charset => 'UTF-8');
my $c = $q->param('c') || "";
if (open(my $fh, ">>", $LOG_FILE)) {
print $fh $c."\n";
close($fh);
}
20180126214840,明るさ変化あり 20180126220003,誰かいる 20180126220127,誰かいる 20180126222112,明るさ変化あり 20180126223515,ボタン押された 20180126230128,ボタン押された