-
Notifications
You must be signed in to change notification settings - Fork 0
/
now.js
26 lines (24 loc) · 805 Bytes
/
now.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function _c (id) {
$.getJSON("https://mc3.nakn.jp/api/ytquestion", { nowshow: id}).done(function(data) {
if (data.firstid == Number($('#nowid').text())) return;
$('#nowid').text("");
$('#nowc').text("");
$('#title').text(data.title);
$('#nowid').text(data.firstid);
$('#nowc').text(data.first?data.first:"募集中...");
}).fail(function(err) {
$('#nowc').text("接続出来ません");
});
}
function _getargs () {
var arg = new Object;
url = location.search.substring(1).split('&');
for(i=0; url[i]; i++) { var k = url[i].split('='); arg[k[0]] = k[1];}
return arg;
}
$(function () {
_c(decodeURIComponent(_getargs().get));
setInterval(() => {
_c(decodeURIComponent(_getargs().get));
}, 1000);
});