A23187 大佬有话说 :
loc签到脚本 bash 版
本帖最后由 A23187 于 2020-3-9 12:41 编辑
看到有人发过python等其他的版本,自己在用的就一个 bash,再配合 cronrtab 就可以自动刷了
#!/bin/bash
cookie=’这里放你的cookie’
err() {
echo $1 | mailx -s ‘【错误】全球主机交流论坛’ $recipient
}
log() {
# echo $1 | mailx -s ‘【成功】全球主机交流论坛’ $recipient
echo $1
}
# 签到
curl -s ‘https://www.hostloc.com/forum.php’ -H ‘authority: www.hostloc.com’ -H ‘upgrade-insecure-requests: 1’ -H ‘sec-fetch-user: ?1’
-H ‘accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9’
-H ‘sec-fetch-site: none’ -H ‘sec-fetch-mode: navigate’ -H ‘accept-encoding: gzip, deflate, br’ -H ‘accept-language: zh-CN,zh;q=0.9’
-H "$cookie" –compressed –output /dev/null
if [[ $? -ne 0 ]]; then
err ‘签到失败,可能需要更新 cookie’
exit 1
fi
sleep 2
# 访问他人空间 10 次
n=10
while [[ $n -gt 0 ]]; do
uid=$RANDOM
if [[ ${uids} -eq 1 ]]; then
continue
fi
uids=1
curl -s "https://www.hostloc.com/space-uid-$uid.html" -H ‘authority: www.hostloc.com’ -H ‘upgrade-insecure-requests: 1’ -H ‘sec-fetch-user: ?1’
-H ‘accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9’
-H ‘sec-fetch-site: none’ -H ‘sec-fetch-mode: navigate’ -H ‘accept-encoding: gzip, deflate, br’ -H ‘accept-language: zh-CN,zh;q=0.9’
-H "$cookie" –compressed –output /dev/null
if [[ $? -eq 0 ]]; then
n=$((n-1))
else
err ‘刷积分失败,可能需要更新 cookie’
exit 2
fi
sleep 2
done
log ‘成功签到 + 刷积分’
exit 0
脚本主要是先登录签到,然后随机访问他人空间,共10次。失败时会发邮件给自己提示要更新 cookie
至于结合 crontab,我想也不用我多说吧。
星月云 大佬有话说 :
一天多少积分呀
inkedus 大佬有话说 :
大佬牛逼
–< 邂逅本身,就是一种奇迹啊。——《游魂》 >–
民工三代 大佬有话说 :
我看不懂!@看图纸比看着简单
Mr.Bean 大佬有话说 :
在做诸位都是秒男:lol
zdszf 大佬有话说 :
https://raw.githubusercontent.com/mixool/script/debian-9/hostloc_mu.sh
坏鱼炒年糕 大佬有话说 :
直接用github版 服务器都不要
bot 大佬有话说 :
各版本签到互相pk
Init 大佬有话说 :
顶大佬!
lpssxs 大佬有话说 :
坏鱼炒年糕 大佬有话说 : 2020-3-9 12:51
直接用github版 服务器都不要
大佬给个链接~