ReleaseNews(2000);
return { rankingList: GetRankingList(5), chatList: GetChatList() };
function GetRankingList(front) {
var rankingList= new Array();
var i = 0;
var div = document.body.querySelector('.billboard.dark');
if (div != null) {
if (div.className == 'billboard dark') div.firstChild.click();
if (div.className == 'billboard dark border-radius') {
for (var li of div.querySelectorAll('.billboard-list-item')) {
if (i++ == front) break;
var name = li.querySelector('.name');
var contribution = li.querySelector('.ks-coin-count');
if(contribution != null){
rankingList.push(name.innerText +":"+ contribution.innerText);
}else{
rankingList.push(name.innerText);
}
}
}
}
return rankingList
}
function GetChatList() {
var chatList = new Array();
var ul = document.body.querySelector('.chat-history');
if (ul != null) {
if (ul.clientHeight == ul.scrollHeight) {
var li_Add = document.createElement('li');
li_Add.innerHTML = '一一一';
li_Add.style.fontSize = '300px';
li_Add.style.color = '#17191d';
ul.appendChild(li_Add);
}
if (ul.scrollTop != 0) ul.scrollTop = 0;
for (var li of ul.getElementsByClassName('chat-info')) {
chatList.push(li.innerText.replace(/\s/g, ''));
li.remove();
}
}
return chatList;
}
function ReleaseNews(quantity) {
var div = document.body.querySelector('.chat-new-message');
if (div != null) {
if (parseInt(div.innerText.replace('条新消息', '')) > quantity) div.click();
}
}
console