Commit e22da6ac authored by 神楽坂玲奈's avatar 神楽坂玲奈

Init

parent b7239608
......@@ -10,6 +10,7 @@ import 'rxjs/Rx';
})
export class StoreComponent implements OnInit {
signups: number;
online: number;
constructor (private http: Http) {
}
......@@ -21,5 +22,9 @@ export class StoreComponent implements OnInit {
let data = await this.http.get('https://ygobbs.com/admin/dashboard.json', {search: params})
.map(response => response.json()).toPromise();
this.signups = data.global_reports.find((item: any) => item.type === 'signups').total;
let document = await this.http.get('https://chat.mycard.moe/stats/online')
.map(response => new DOMParser().parseFromString(response.text(), 'text/xml')).toPromise();
this.online = parseInt(document.querySelector('#content > table > tbody > tr:nth-child(2) > td:nth-child(2)').textContent);
}
}
......@@ -62,7 +62,6 @@
true,
"single"
],
"radix": true,
"semicolon": [
"always"
],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment