Batch export your penguin friends with one click.
Attach the original author's code first
/**
* @author ius.
* @date 2022/8/1
* @introduction gainQQFriends List
*/
function getCookie(aim) {
const allText = (/\s*/g, ''); //
oneText = (";");
for (var two of oneText) {
const three = ("=");
if (aim === three[0]) {
return two;
}
}
}
const gtk = ();
const uin = getCookie("uin").substring(5);
const xhr = new XMLHttpRequest();
const qzonetoken = window.shine0callback;
var url = '/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=';
= function () {
if ( == 4 && == 200) {
const json = ()
const allGroup = ;
const allFriend = ;
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";
}
}
}
(consoleContext);
}
}
('GET', url)
= true;
()
The information obtained is the friend's name + (account number)
Here's my improved version
The information obtained is the account number
// Get the value of a cookie with the specified name
function getCookie(aim) {
// Remove spaces from the cookie string.
const allText = (/\s*/g, ''); // Split the cookie string into an array by semicolon.
// Split the cookie string into an array by semicolon.
const oneText = (";"); // split the cookie string into arrays by semicolons
// Iterate over each cookie
for (var two of oneText) {
// Split the cookies into key-value pairs by equal sign
const three = ("=");
// Check if the current cookie name matches the target name
if (aim === three[0]) {
return two; // return the matching cookie
}
}
}
// Get the user's GTK (the token used for authentication)
const gtk = ();
// Get the user's uin from the cookie with the prefix removed
const uin = getCookie("uin").substring(5);
// Create an XMLHttpRequest object to send an HTTP request
const xhr = new XMLHttpRequest(); // Create an XMLHttpRequest object to send HTTP requests.
// Get the qzonetoken
const qzonetoken = window.shine0callback;
// Construct the request URL
var url = '/friend/mfriend_list?qzonetoken=' + qzonetoken + '&g_tk=' + gtk + '&res_uin=' + uin + '&res_type=normal&format=json& amp;count_per_page=10&page_index=0&page_type=0&mayknowuin=&qqmailstat=';
// Set up a callback function for request status changes
= function () {
// When the request is complete and the response status is 200 (successful)
if ( == 4 && == 200) {
// Parsing the response text in JSON format
const json = ();
// Get all groups
const allGroup = ;
// Get a list of all friends.
const allFriend = ;
// Iterate over each group
for (var groupid of allGroup) {
// Iterate over each friend
for (const friendid of allFriend) {
// Check if the groupid of the friend matches the current groupid
if (groupid["gpid"] === friendid["groupid"]) {
// If it matches, print the friend's uin (account number), on a separate line for each account number
(friendid["uin"]);
}
}
}
}
}
// Initialize the GET request
('GET', url); // Allow credentials (such as cookies) to be carried.
// Allow carrying credentials (e.g. cookies)
= true; // Send the request.
// Send the request
();
Usage
Computer EDGE or Chrome
Open Qzone login then switch to emulation mode
Then in change the address to:/mqzone/index
Finally, put the code in the console and enter and you're done!
posted @
2024-09-22 19:10
Little kBlog
Read (0)
Comments (0)
compiler
favorite
report (malefactors to the police)