当前位置:网站首页>[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 .)
边栏推荐
- 3500 word summary: a complete set of skills that a qualified software testing engineer needs to master
- 运算符重载的初识
- My PMP learning test experience
- 修复表中的名字(首字符大写,其他小写)
- halcon变量窗口的图像变量不显示,重启软件和电脑都没用
- Delete duplicate email
- 模板:全局平衡二叉树
- SQL语句关联表 如何添加关联表的条件 [需要null值或不需要null值]
- After working for 6 years, let's take stock of the golden rule of the workplace where workers mix up
- Laravel event & Monitoring
猜你喜欢

What are the applications of SMS in enterprises?

删除重复的电子邮箱

SWT / anr problem - binder stuck

Qu'est - ce que le PMP?

QML control type: tooltip

Delete duplicate email

3500 word summary: a complete set of skills that a qualified software testing engineer needs to master

求两个线段公共部分的长度

思特奇加入openGauss开源社区,共同推动数据库产业生态发展

手机edge浏览器无法打开三方应用
随机推荐
With regard to the white box test, you have to master these skills~
工厂+策略模式
Selenium classic interview question - multi window switching solution
[Agora] user management
QT web 开发 - video -- 笔记
[JS adds attributes to elements: setAttribute; classlist.remove; classlist.add;]
Mathematical knowledge: finding combinatorial number IV - finding combinatorial number
AS400 大廠面試
Pytorch - - Basic Reference North Deux élèves du secondaire peuvent comprendre [Rétropropagation et Gradient descendant]
What other hot spots are hidden under 1500W playback? Station B 2 future trends you can't miss
Alphabet rearrange inator 3000 (dictionary tree custom sorting)
What are the preferential activities for stock account opening? In addition, is it safe to open a mobile account?
[fundamentals of wireless communication-15]: illustrated mobile communication technology and application development-3-overview of digital communication 2G GSM, CDMA, 3G wdcma/cdma200/td-scdma, 4G LTE
opencv -- 笔记
静态域与静态方法
機器學習10-信念貝葉斯分類器
计算特殊奖金
Leetcode 面试题 17.10. 主要元素
The whole process of AS400 API from zero to one
AS400 entretien d'usine

