##超话积分任务
##功能一:自动签到(签固定超话);
##功能二:自动打捞帖子(可配置数量);
##功能三:自动发帖();
####1.需要电脑网页谷歌浏览器 chorme;
####2.先在网页中登录微博;
//第一次先配好插件,以后执行就好!
好,开始!
step1:下载魂签插件,扩展到chrome插件。
1.下载bulid.zip文件,在本地解压()
![](https://img2020.cnblogs.com/blog/1979700/202008/1979700-20200818231018429-1328724877.png)
https://files.cnblogs.com/files/sspox/build.zip(点击下载)
2.打开谷歌Chrome浏览器,输入网址chrome://extensions/
3.点击加载已解压的扩展程序,选择解压好的build文件夹
![](https://img2020.cnblogs.com/blog/1979700/202008/1979700-20200818231201369-2046940294.png)
4.谷歌会自动加载插件魂签,记得打开右下角的开关
![](https://img2020.cnblogs.com/blog/1979700/202008/1979700-20200818231322369-1651941443.png)
5.打开开关之后,插件图标会自动出现在地址栏右侧
![](https://img2020.cnblogs.com/blog/1979700/202008/1979700-20200818231602608-1695375295.png)
6.点击图标弹出任务框,点击右上角任务管理(里面的参数配置不用管)进入脚本管理页面
![](https://img2020.cnblogs.com/blog/1979700/202008/1979700-20200818231645024-797545457.png)
![](https://img2020.cnblogs.com/blog/1979700/202008/1979700-20200825235724479-944918902.png)
好了!插件就算安装完成了
step2:进入魂签页面点击添加脚本
1.点击添加脚本
2.复制脚本到输入框里
3.复制完之后点右下角的调试参数,(只有自动打捞需要配置参数)
4.配置参数后,点击保存。
5.到脚本列表点播放按钮,就开始自动操作了
![](https://img2020.cnblogs.com/blog/1979700/202008/1979700-20200826000348546-1977114867.png)
脚本1:自动签到(签的是我设置的这几个固定超话,!!这几个超话一定要先关注)
---------------------------------------------------------------------------------------------------------------------------------------------------------------
// ==UserScript==
// @name autoSign
// @namespace https://weibo.com
// @version 1.0.0
// @author waterWalk
// @loginURL https://weibo.com
// @expire 900e3
// @domain weibo.com
// ==/UserScript==
const aimchaohuas = [
{
"hid": "1008084b04becb587d5dbf395bae69bcffa42e",
"hname": "陈意涵estelle超话"
},
{
"hid": "10080857b9b9a2298cfed9e6b077db09b4ac9f",
"hname": "激情打捞队超话"
},
{
"hid": "10080801c4e7380a7f357e10d383e7d07d5b0c",
"hname": "爱菲儿超话"
},
{
"hid": "100808fcba2aa627335c966c27b4ba4d3d4d72",
"hname": "babyfairchen超话"
},
{
"hid": "100808a5f57a83ea1072c6ce1da536044f9619",
"hname": "喊涵回家吃饭啦"
},
{
"hid": "1008084648889263909095d2fd8ec05e02a43d",
"hname": "小陈总办公室超话"
},
{
"hid": "100808754ee7e074821080d6b420f8fd4ae2f6",
"hname": "爱涵超话"
},
{
"hid": "1008084c38ae0a1f7fcd12cacd64044d00816a",
"hname": "出生在地球向往外太空"
}
];
const timestamp = new Date().getTime();
function sleep(milliseconds) {
return new Promise((resolve) => setTimeout(resolve, milliseconds));
}
async function doSignIn(hid, hname) {
const url = 'https://weibo.com/p/aj/general/button?ajwvr=6';
const rsp = await axios({
url: url,
method: 'GET',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Requested-With': 'XMLHttpRequest',
'Origin': 'https://weibo.com',
'Referer': `https://weibo.com/p/${hid}/super_index`
},
params: {
'api': 'http://i.huati.weibo.com/aj/super/checkin',
'texta': '签到',
'textb': '已签到',
'status': '0',
'id': hid,
'location': 'page_100808_super_index',
'timezone': 'GMT 0800',
'lang': 'zh-cn',
'plat': 'Win32',
'ua': 'Mozilla/5.0 (Windows%20NT%2010.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0',
'screen': '1920*1080',
'__rnd': timestamp,
}
});
if (rsp.status != 200) {
return {
success: false,
msg: `超话签到[${hname}]: ${rsp.status}-操作失败`
};
}
return {
success: rsp.data.code == '100000' || rsp.data.code == '382004',
msg: `超话签到[${hname}]: ${rsp.data.code}-${rsp.data.msg}`
};
}
exports.run = async function(param) {
alert("超话签到开始!")
let count = 0;
for (const chaohua of aimchaohuas) {
const hid = chaohua['hid'];
const hname = chaohua['hname'];
let result = await doSignIn(hid, hname);
if (!result.success) {
alert(result.msg);
throw result.msg;
}
++count;
await sleep(3000);
}
alert('操作成功!完成数量[' + count+']');
return `操作成功: 完成数量[${count}]`;
};
exports.check = async function(param) {
return true;
};
---------------------------------------------------------------------------------------------------------------------------------------------------------------
脚本2:自动发帖(发帖内容也先配置好了,执行一次自动在激情打捞队超话里发一个贴)
---------------------------------------------------------------------------------------------------------------------------------------------------------------
// ==UserScript==
// @name autoSendweibo
// @namespace https://weibo.com
// @version 1.0.0
// @author waterWalk
// @loginURL https://weibo.com
// @expire 900e3
// @domain weibo.com
// ==/UserScript==
const chaohuas = [
{
"hid": "10080857b9b9a2298cfed9e6b077db09b4ac9f",
"hname": "激情打捞队超话",
"text": "#激情打捞队[超话]# #陈意涵estelle飞行模式#\r\n"
+"我想我对你也许,是兵荒马乱\r\n"
+"它千回百转,再将我点燃\r\n"
+"我想我对你也许,有不真实感\r\n"
+"一点点喜欢。#陈意涵Estelle一点点#\r\n"
+"@陈意涵Estelle \r\n"
+"http://t.cn/A62BlO32",
"picture": ""
}
];
const timestamp = new Date().getTime();
let sid = '0';
function sleep(milliseconds) {
return new Promise((resolve) => setTimeout(resolve, milliseconds));
}
function objectToUrlEncodedParams(obj) {
return Object.entries(obj)
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
.join('&');
}
async function goHome() {
const url = `https://weibo.com`;
const rsp = await axios.get(url);
if (rsp.status != 200) {
return {
success: false,
msg: `进入主页: ${rsp.status}-操作失败`
};
}
const jstring = JSON.stringify(rsp.data);
const result = /CONFIG\['uid'\]='(\d*?)'/.exec(jstring);
if (result == null || result.length < 2) {
return {
success: false,
msg: `用户ID: 获取失败`
};
}
sid = result[1];
return {
success: true,
msg: `用户ID: ${sid}`
};
}
async function doPost(hid, hname, text, picture) {
const url = `https://weibo.com/p/aj/proxy?ajwvr=6&__rnd=${timestamp}`;
const rsp = await axios({
url: url,
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Requested-With': 'XMLHttpRequest',
'Origin': 'https://weibo.com',
'Referer': `https://weibo.com/p/${hid}/super_index`
},
data: {
'id': hid,
'domain': '100808',
'module': 'share_topic',
'title': '%E5%8F%91%E5%B8%96',
'content': '',
'api_url': 'http://i.huati.weibo.com/pcpage/super/publisher',
'spr': '',
'extraurl': '',
'is_stock': '',
'check_url': `http%3A%2F%2Fi.huati.weibo.com%2Faj%2Fsuperpublishauth%26pageid%3D${hid}%26uid%3D1764819037`,
'location': 'page_100808_super_index',
'text': text,
'appkey': '',
'style_type': 1,
'pic_id': picture,
'tid': '',
'pdetail': hid,
'mid': '',
'isReEdit': 'false',
'sync_wb': 0,
'pub_source': 'page_2',
'api': `http://i.huati.weibo.com/pcpage/operation/publisher/sendcontent?sign=super&page_id=${hid}`,
'longtext': 1,
'topic_id': `1022:${hid}`,
'pub_type': 'dialog',
'_t': 0
},
transformRequest: [function (data) {
return objectToUrlEncodedParams(data);
}]
});
if (rsp.status != 200) {
return {
success: false,
msg: `超话发帖[${hname}]: ${rsp.status}-操作失败`
};
}
return {
success: rsp.data.code == '100000',
msg: `超话发帖[${hname}]: ${rsp.data.code}-${rsp.data.msg}`
};
}
exports.run = async function(param) {
let result = await goHome();
if (!result.success) {
throw result.msg;
}
let count = 0;
for (const chaohua of chaohuas) {
const hid = chaohua['hid'];
const hname = chaohua['hname'];
const text = chaohua['text'];
const picture = chaohua['picture'];
let result = await doPost(hid, hname, text, picture);
if (!result.success) {
throw result.msg;
}
++count;
await sleep(3000);
}
return `操作成功: 完成数量[${count}]`;
};
exports.check = async function(param) {
return true;
};
---------------------------------------------------------------------------------------------------------------------------------------------------------------
脚本3:自动捞贴(可以配置打捞评论的数量和发送的文本)
#### commentNum // 执行一次评论的帖子数量,我自己一般配20或25
#### commentText //评论的内容
粘贴到脚本框后点击调试参数后会出来这两个参数让你填写
----------------------------------------------------------------------------------------------------------------------------------------------------------------
// ==UserScript==
// @name autoSalvage
// @namespace https://weibo.com
// @version 1.0.0
// @author waterWalk
// @loginURL https://weibo.com
// @expire 900e3
// @domain weibo.com
// @domain m.weibo.cn
// @param commentNum
// @param commentText
// ==/UserScript==
const aimChaohuas = [
{
"hid": "10080857b9b9a2298cfed9e6b077db09b4ac9f",
"hname": "激情打捞队",
"text": "哈哈,捞你",
"number": 3,
"isFill": 20
}
];
const timestamp = new Date().getTime();
let sid = '0';
exports.run = async function(param){
let result = await goHome();
if (!result.success) {
throw result.msg;
}
let count = 0;
for (const item of aimChaohuas) {
const hid = item['hid'];
const hname = item['hname'];
const text = param.commentText;
const number = param.commentNum;
const isFill = item['isFill'];
let result = await doSalvage(hid, hname, text, number, isFill);
if (!result.success) {
throw result.msg;
}
++count;
await sleep(3000);
}
return `操作成功: 完成数量[${count}]`;
}
//带着cookie自动登录主页
async function goHome(){
const url = `https://weibo.com`;
const rsp = await axios.get(url);
if (rsp.status != 200) {
return {
success: false,
msg: `进入主页: ${rsp.status}-操作失败`
};
}
const jstring = JSON.stringify(rsp.data);
const result = /CONFIG\['uid'\]='(\d*?)'/.exec(jstring);
if (result == null || result.length < 2) {
return {
success: false,
msg: `用户ID: 获取失败`
};
}
sid = result[1];
return {
success: true,
msg: `用户ID: ${sid}`
};
}
//激情打捞
async function doSalvage(hid, hname, text, number, isFill){
//进入超话主页拿到当前微博sinceId/mid
const url = 'https://m.weibo.cn/api/container/getIndex';
let sinceId = 0;
const midList = [];
while (midList.length < number) {
const rsp = await axios({
url: url,
method: 'GET',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Requested-With': 'XMLHttpRequest',
'Origin': 'https://m.weibo.cn',
'Referer': 'https://m.weibo.cn'
},
params: {
'containerid': hid + '_-_sort_time',
'luicode': '10000011',
'lfid': hid,
'since_id': sinceId
}
});
if (rsp.status != 200) {
return {
success: false,
msg: `超话捞帖: ${rsp.status}-操作失败`
};
}
const jstring = JSON.stringify(rsp.data);
//拿到sinceId
const sinceIdReg = /"since_id":(\d*?),/g;
if ((matches = sinceIdReg.exec(jstring)) != null) {
sinceId = matches[1];
}
if (sinceId == 0) {
break;
}
const midReg = /"mid":"(.*?)"/g;
const mids = [];
while ((matches = midReg.exec(jstring)) != null) {
mids.push(matches[1]);
}
const commentsCountReg = /"comments_count":(\d*?),/g;
const commentsCounts = [];
while ((matches = commentsCountReg.exec(jstring)) != null) {
commentsCounts.push(matches[1]);
}
if (mids.length != commentsCounts.length) {
break;
}
for (let i = 0; i < mids.length; ++i) {
const mid = mids[i];
const commentsCount = commentsCounts[i];
if (isFill < 0 || commentsCount < isFill) {
midList.push(mid);
}
if (midList.length >= number) {
break;
}
}
}
let count = 0;
for (const mid of midList) {
const result = await doComment(hid, hname, mid, text, 0);
if (!result.success) {
throw result.msg;
}
++count;
await sleep(3000);
}
return {
success: true,
msg: `超话捞帖: 完成数量[${count}]`
};
}
async function doComment(hid, hname, mid, text, forward){
const url = `https://weibo.com/aj/v6/comment/add?ajwvr=6&__rnd=${timestamp}`;
const rsp = await axios({
url: url,
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Requested-With': 'XMLHttpRequest',
'Origin': 'https://weibo.com',
'Referer': `https://weibo.com/p/${hid}/super_index`
},
data: {
'act': 'post',
'mid': mid,
'uid': sid,
'forward': forward,
'isroot': 0,
'content': text,
'location': 'page_100808_super_index',
'module': 'scommlist',
'group_source': '',
'filter_actionlog': '',
'pdetail': hid,
'_t': 0
},
transformRequest: [function (data) {
return objectToUrlEncodedParams(data);
}]
});
if (rsp.status != 200) {
return {
success: false,
msg: `超话回帖[${hname}]: ${rsp.status}-操作失败`
};
}
return {
success: rsp.data.code == '100000' || rsp.data.code == '100001',
msg: `超话回帖[${hname}]: ${rsp.data.code}-${rsp.data.msg}`
};
}
exports.check = async function(param) {
return true;
};
function sleep(milliseconds) {
return new Promise((resolve) => setTimeout(resolve, milliseconds));
}
function objectToUrlEncodedParams(obj) {
return Object.entries(obj)
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
.join('&');
}
-----------------------------------------------------------------------------------------------------------------------------------
最后,如果有多个账号,可以自己在微博网页切换微博账号后执行脚本