Created
May 10, 2015 04:43
-
-
Save kasuganosora/e415d1df07ad46aa2f2d to your computer and use it in GitHub Desktop.
设置bilibilid的消息全部已读
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.getJSON("http://member.bilibili.com/message.do?act=notify_list&page=1") | |
.done(function(data){ | |
var maxPage = data.numPages; | |
for(var page = 1; page <= maxPage; page++){ | |
$.getJSON("http://member.bilibili.com/message.do?act=notify_list&page=" + page) | |
.done(function(d){ | |
for(var j in d){ | |
if(!$.isNumeric(j)){ | |
continue; | |
} | |
var item = d[j]; | |
if(item.isread){ | |
continue; | |
} | |
$.get("http://member.bilibili.com/message.do?act=set_notify_read&type=user&nf_id=" +item.nf_id); | |
} | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment