• Stars
    star
    225
  • Rank 177,187 (Top 4 %)
  • Language
  • License
    MIT License
  • Created about 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

微博批量关注 (转移关注列表)

微博批量关注 (转移关注列表)

好像并没有什么卵用

起因

使用方法

得到 A 账号关注列表

  1. 前往微博 H5 版首页 (https://m.weibo.cn)
  2. 登录 A 账号
  3. 右键 "检查" 打开开发者工具,复制下面的代码,粘贴到控制台,等待结果并复制
  • 关注数量较多时请耐心等待
  • 由于接口限制可能无法获得完整的关注列表
(() => {
	const follows = []
	const sleep = time => () => new Promise(resolve => setTimeout(resolve, time))
	const query = page =>
		fetch(
			`/api/container/getIndex?containerid=231093_-_selffollowed&page=${page}`, 
			{ headers: { 'X-XSRF-TOKEN': (document.cookie.match(/XSRF-TOKEN=([^;$]+)/) || [])[1] || '' } }
		) 
			.then(response => response.json())
			.then(body => {
				const { data, msg, ok } = body
				if (msg === '这里还没有内容') return Promise.reject(new Error('finish'))
				if (ok !== 1) return Promise.reject(new Error(msg))
				data.cards.forEach(group => group.card_group.forEach(card => card.user && follows.push(card.user.id)))
			})
	const polling = (page = 1) => query(page).then(sleep(1500)).then(() => polling(page + 1))

	polling()
		.catch(error => console.warn(`${error.message === 'finish' ? '获取完成' : `出错了 (${error.message})` }\n\n${JSON.stringify(follows)}`))
})()

按列表为 B 账号添加关注

  1. 前往 PC 版首页 (www.weibo.com)
  2. 退出 A 账号,登录 B 账号
  3. 右键 "检查" 打开开发者工具,复制下面的代码并填入上一步得到的列表,粘贴到控制台,等待全部关注完成

每日关注数量有上限,关注数量较多需要分批(分日)处理

(list => {
	let index = 0
	const { length } = list
	const failed = []
	const deviation = () => Math.round(Math.random() * 100)
	const sleep = time => () => new Promise(resolve => setTimeout(resolve, time))
	const follow = uid =>
		fetch(`/aj/f/followed?ajwvr=6&__rnd=${Date.now()}`, {
			method: 'POST',
			headers: { 'content-type': 'application/x-www-form-urlencoded' },
			body: `uid=${uid}&objectid=&f=1&extra=&refer_sort=&refer_flag=1005050001_&location=page_100505_home&oid=${uid}&wforce=1&nogroup=false&fnick=&refer_lflag=&refer_from=profile_headerv6&template=7&special_focus=1&isrecommend=1&is_special=0&_t=0`
		})
			.then(response => response.json())
			.then(data => {
				if (data.code === '100000')
					console.log(`${index}/${length}`, uid, data.data.fnick, '关注成功')
				else {
					console.log(`${index}/${length}`, uid, '关注失败')
					failed.push(uid)
					if (data.code === '100027') return Promise.reject(new Error('captcha is required'))
				}
			})
	const subscribe = () => index < length ? follow(list[index++]).then(sleep(4000 + deviation())).then(subscribe) : Promise.resolve()

	subscribe()
		.catch(error => console.error(`出错了 (${error.message})${list.slice(index).length ? `\n\n以下 ID 还未处理,请之后再试\n\n${JSON.stringify(list.slice(index))}` : ''}`))
		.then(() => failed.length && console.warn(`以下 ID 关注失败,请重试或手动关注\n\n${JSON.stringify(failed)}`))
})(/*上一步的结果*/)

More Repositories

1

UnblockNeteaseMusic

Revive unavailable songs for Netease Cloud Music
JavaScript
17,035
star
2

vsc-netease-music

UNOFFICIAL Netease Music extension for Visual Studio Code
JavaScript
1,022
star
3

Glee

也是个网易云第三方😶
JavaScript
355
star
4

weiboPicDownloader

Download weibo images without logging-in
Python
260
star
5

163marker

Add "163 key" for media file
Python
124
star
6

onemoretime

Nogizaka46 graduated members' blog archive
HTML
42
star
7

Nroxy

A VPNService based HTTP Proxy APP bundled with Node.js Runtime
C
41
star
8

Jike-Bus

🚍 即刻 Ⓙ SDK for Node.js
JavaScript
23
star
9

KeyakiMsgAssistant-Xposed

Xposed module for "欅坂46/日向坂46 メッセージ" app
Java
15
star
10

idol

坂道系官博聚合阅读
Python
14
star
11

Jike-Patcher

The Sun Jike Rises
Smali
12
star
12

Unblock163MusicClient-Remote

Serverless Backend for Unblock163MusicClient-Xposed
JavaScript
12
star
13

Jike.Tab

New Tab Page for Jike.APP
JavaScript
9
star
14

JikeRedirect

Redirect Jike API to Jellow API
JavaScript
8
star
15

JikeRedirect-Xposed

Redirect Jike API to Jellow API
Java
8
star
16

KeyakiMsgAssistant

CLI tool for extracting resources from "欅坂46/日向坂46 メッセージ" app
Python
7
star
17

Jellow-Patcher

Make Jellow APP work again
Smali
6
star
18

electron-toutiao

开发者头条 Menubar application for Mac
JavaScript
6
star
19

NogiKeya

Utilities for collecting data from nogi‘s & keyaki’s official website
Python
5
star
20

bannero

An image API for simpledesktops.com
5
star
21

algorithm-review

被笔试虐得不要不要的
Python
4
star
22

contribution-graph

毕业衫创意 UESTC SCSE 2014
4
star
23

idol-dev

坂道系官博聚合阅读
JavaScript
3
star
24

platform

Moving instructions for nogimono
Python
3
star
25

Deno-Proxy

simple HTTP proxy
JavaScript
3
star
26

tauri-start

JavaScript
2
star
27

RemoteAudioElement

HTMLAudioElement for Node.js
JavaScript
2
star
28

nogimono

乃木物平台
Python
2
star
29

groove-music-concept

Concept design for Groove Music (For fun)
JavaScript
2
star
30

jellow

JavaScript
2
star
31

2048

2048 Game
2
star
32

kuuki-heroku

kuuki's server deployed on heroku
Python
2
star
33

sousenkyo-auto

AKB48 sousenkyo vote
Python
1
star
34

TimeFlies

new tab extension makes you more motivated
CSS
1
star
35

kuuki-predict

Python
1
star
36

onemorechance

Nogizaka46 graduated members' blog archive
HTML
1
star
37

ngx-plainindex

Plain indexes attachment for the Nginx web server
JavaScript
1
star
38

tiny-html-decorator

HTML
1
star
39

platform-api

APIs' documentation for nogimono
1
star
40

JellowRedirect-Xposed

Redirect Jellow API to Jike API
Java
1
star
41

dropbox

JavaScript
1
star
42

EXP-Weibo

不简单的微博平台
Python
1
star