700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 原生JS获取QQ好友列表

原生JS获取QQ好友列表

时间:2024-05-17 18:38:34

相关推荐

原生JS获取QQ好友列表

JS内容如下:

/*** @author ius.* @date /8/1* @introduction 获取QQ好友列表*/function getCookie(aim) {const allText = document.cookie.replace(/\s*/g, ''); //document.cookieoneText = allText.split(";");for (var two of oneText) {const three = two.split("=");if (aim === three[0]) {return two;}}}const gtk = user.getToken();const uin = getCookie("uin").substring(5);const xhr = new XMLHttpRequest();const qzonetoken = window.shine0callback;var url = 'https://mobile./friend/mfriend_list?qzonetoken=' + qzonetoken + '&g_tk=' + gtk + '&res_uin=' + uin + '&res_type=normal&format=json&count_per_page=10&page_index=0&page_type=0&mayknowuin=&qqmailstat=';xhr.onreadystatechange = function () {if (this.readyState == 4 && this.status == 200) {const json = JSON.parse(xhr.responseText)const allGroup = json.data.gpnames;const allFriend = json.data.list;var consoleContext = "";for (var groupid of allGroup) {consoleContext += groupid["gpname"] + ":\n";for (const friendid of allFriend) {if (groupid["gpid"] === friendid["groupid"]) {consoleContext += " " + friendid["remark"] + "(" + friendid["uin"] + ")" + "\n";}}}console.log(consoleContext);}}xhr.open('GET', url)xhr.withCredentials = true;xhr.send()

视频教程链接:/video/BV18g411C7VZ/

使用以上JS,需要进入h5版的qq空间

H5QQ空间:https://h5./mqzone/index

该方法导出QQ好友需要使用电脑浏览器,请确保您有可以正常使用的电脑,以及一个正常使用的浏览器,千万不要使用ie浏览器。。

我真的服了为啥说我质量低呢,就无语

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。