当前位置:网站首页>[JS] [Nuggets] get people who are not followers
[JS] [Nuggets] get people who are not followers
2022-07-01 02:09:00 【Southerner】
Logical copy source :[JS It's fun ] Nuggets creators must have : Monitor who shut you down every day ?
Effect display

Operation process
Copy the complete code to the browser console for output .
( notes : If there is already a named ,① You can try to change the method name 、 Variable name .② Clear the browser cache )
preparation ( Get the corresponding aid、uuid、user_id)
Such as : see ④ The link of corresponds to the following parameter
Complete code
Tip: It is necessary to replace it with your corresponding aid、uuid、user_id; Or you will get what you ask me ~
// Yours aid
var aid = "2608";
// Yours uuid
var uuid = "7004672915649250827";
// Yours user_id
var user_id = "2840793779295133";
// Don't put too much pressure on Nuggets , We define a sleep function ,0.5 Just ask once per second
const sleep = async () => new Promise(resolve => setTimeout(resolve, 500));
// Get all new fans , Save to followers.
const getFollowees = async () => {
const followers = {
};
console.log(' Start reading your fans ');
for (let i = 0; i < 100; i++) {
const res = await fetch("https://api.juejin.cn/user_api/v1/follow/followees?aid=" + aid + "&uuid=" + uuid + "&user_id=" + user_id + "&cursor=" + i * 20 + "&limit=20", {
"headers": {
"content-type": "application/json",
},
"referrer": "https://juejin.cn/",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": null,
"method": "GET",
"mode": "cors",
"credentials": "include"
});
const data = await res.json();
const result = data.data.data;
result.forEach(fan => {
followers[fan.user_id] = fan.user_name;
});
// If the number of pages is less than 20, The description is the last page , End of cycle
if (result.length < 20) break;
// Don't put too much pressure on Nuggets , We 1 Just ask once per second
await sleep();
}
console.log(' Finished reading your fans ');
return followers;
}
// Get all new fans , Save to followers.
const getFollowers = async () => {
const followers = {
};
console.log(' Start reading your fans ');
for (let i = 0; i < 100; i++) {
const res = await fetch("https://api.juejin.cn/user_api/v1/follow/followers?aid=" + aid + "&uuid=" + uuid + "&user_id=" + user_id + "&cursor=" + i * 20 + "&limit=20", {
"headers": {
"content-type": "application/json",
},
"referrer": "https://juejin.cn/",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": null,
"method": "GET",
"mode": "cors",
"credentials": "include"
});
const data = await res.json();
const result = data.data.data;
result.forEach(fan => {
followers[fan.user_id] = fan.user_name;
});
// If the number of pages is less than 20, The description is the last page , End of cycle
if (result.length < 20) break;
// Don't put too much pressure on Nuggets , We 1 Just ask once per second
await sleep();
}
console.log(' Finished reading your fans ');
return followers;
}
// Get your fans
const followers = await getFollowers();
// Get your attention
const followees = await getFollowees();
// Check whether your attention is in your fans
const checkFollowees = Object.keys(followees).filter(fan => !(fan in followers));
console.log(checkFollowees.map(id => followees[id]));
More fun , Please refer to this big man ~
Today, it's just a big guy's Porter !~
HullQin
Article small tail
Article writing 、 Templates 、 The small tail of the article can be referred to :《 writing “ Small mind ”》
Thank you for seeing the last , Finally, two more points ~
① If you hold a different view , You are welcome to leave a message at the bottom of the article 、 Comment on .
② If it helps you , Or if you agree , Welcome to give a little praise , support ~
I'm a southerner , A southerner who loves computers and loves his motherland more .
( The content of this article is only for learning reference , If there is any infringement , So sorry , Please contact the author immediately to delete .)
边栏推荐
- 7-2 拼题A打卡奖励 dp
- SQL语句关联表 如何添加关联表的条件 [需要null值或不需要null值]
- FL studio20.9 fruit software advanced Chinese edition electronic music arrangement
- The image variables in the Halcon variable window are not displayed, and it is useless to restart the software and the computer
- (translation) use eyebrow shaped text to improve Title click through rate
- Mathematical knowledge: finding combinatorial number IV - finding combinatorial number
- MySQL insert \ pre update + judgment condition
- org.redisson.client.RedisResponseTimeoutException: Redis server response timeout (3000 ms)错误解决
- AS400 entretien d'usine
- QT web 开发 - video -- 笔记
猜你喜欢

Analysis on user behavior loss of data exploration e-commerce platform

Calculate special bonus

7-2 拼题A打卡奖励 dp

What other hot spots are hidden under 1500W playback? Station B 2 future trends you can't miss

SWT / anr problem - storagemanagerservice stuck

My PMP learning test experience

The whole process of AS400 API from zero to one
![SQL语句关联表 如何添加关联表的条件 [需要null值或不需要null值]](/img/91/0efbc13597be4dba5b9cf4e8644e35.png)
SQL语句关联表 如何添加关联表的条件 [需要null值或不需要null值]

How does the property send a text message to the owner?
![Pytorch —— 基础指北_贰 高中生都能看懂的[反向传播和梯度下降]](/img/6e/279dbb7a8d7a5ecd240de464c5b8b2.png)
Pytorch —— 基础指北_贰 高中生都能看懂的[反向传播和梯度下降]
随机推荐
How does the property send a text message to the owner?
How do the top ten securities firms open accounts? Also, is it safe to open an account online?
求两个线段公共部分的长度
House change for agricultural products? "Disguised" house purchase subsidy!
org.redisson.client.RedisResponseTimeoutException: Redis server response timeout (3000 ms)错误解决
SWT/ANR问题--Binder Stuck
【毕业季·进击的技术er】--毕业到工作小结
Int and bit group turn to each other
electron之坑addon
What is PMP?
我想知道股票开户怎么开户?究竟网上开户是否安全么?
VirtualBox 安装增强功能
Live shopping mall source code, realize left-right linkage of commodity classification pages
[content of content type request header]
@The difference between configurationproperties and @value
SWT/ANR问题--StorageManagerService卡住
Batch import of Excel data in applet
In the fourth week of June, the list - flying melon data up main growth ranking list (BiliBili platform) was released!
Short message sending solution in medical his industry
MYSQL 数据库查看磁盘占用情况

