Giter VIP home page Giter VIP logo

weibobatchfollow's Introduction

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

好像并没有什么卵用

起因

使用方法

得到 A 账号关注列表

  1. 前往微博 H5 版首页 (https://m.weibo.cn)
  2. 登录 A 账号
  3. 右键 "检查" 打开开发者工具,复制下面的代码,粘贴到控制台,等待结果并复制
(() => {
	let uid = config.uid, follows = []
	const pageQuery = (page = 1) => {
		let xhr = new XMLHttpRequest()	
		xhr.onreadystatechange = () => {
			if(xhr.readyState == 4 && xhr.status == 200){
				let data = JSON.parse(xhr.responseText).data
				if(data.msg == '这里还没有内容') return console.log(JSON.stringify(follows))
				data.cards.forEach(card => follows.push(card.user.id))
				pageQuery(page + 1)
			}
		}
		xhr.open('GET', `/api/container/getSecond?luicode=10000011&lfid=100505${uid}&uid=${uid}&containerid=100505${uid}_-_FOLLOWERS&page=${page}`)
		xhr.send()
	}
	pageQuery()
})()

注:由于接口限制可能无法获得完整的关注列表

按列表为 B 账号添加关注

  1. 前往 PC 版首页 (www.weibo.com)
  2. 退出 A 账号,登录 B 账号
  3. 右键 "检查" 打开开发者工具,复制下面的代码并填入上一步得到的列表,粘贴到控制台,等待全部关注完成
(list => {
	let index = -1, length = list.length
	const follow = uid => {
		let xhr = new XMLHttpRequest()
		xhr.onreadystatechange = () => {
			if(xhr.readyState == 4 && xhr.status == 200){
				let data = JSON.parse(xhr.responseText)
				if(data.code == 100000)
					console.log(`${index + 1}/${length}`, uid, data.data.fnick, '关注成功')
				else if(data.code == 100001)
					console.log(`${index + 1}/${length}`, uid, '关注失败')
			}
		}
		xhr.open('POST', `/aj/f/followed?ajwvr=6&__rnd=${Date.now()}`)
		xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded')
		xhr.send(`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&_t=0`)
	}
	let scheduled = setInterval(() => {
		index += 1
		follow(list[index])
	}, 2000)
	setTimeout(() => {
		clearTimeout(scheduled)
	}, 2000 * length)
})(/*上一步的结果*/)

注:接口似乎完全不管重复关注

weibobatchfollow's People

Contributors

nondanee avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.