吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1751|回复: 1
收起左侧

[会员申请] 申请会员ID:熊二最帅

[复制链接]
吾爱游客  发表于 2022-7-30 18:51
申请ID:熊二最帅
个人邮箱:aly844@aliyun.com
原创技术文章: 油猴脚本通过模拟POST请求完成盘友社区论坛自动回复


资源需要回复才能看见
![](https://s1.ax1x.com/2022/07/30/vi7xmj.png)


手动回复并抓包找到

- 请求响应地址:https://www.panyoubbs.com/index/post/reply.html
- 请求方法: POST

![](https://s1.ax1x.com/2022/07/30/viH9kq.png)



进一步查看请求参数:
![](https://s1.ax1x.com/2022/07/30/vi7jXQ.png)


在网页源代码中可以找到form表单

![](https://s1.ax1x.com/2022/07/30/vi7z0s.png)


根据请求参数和form表单内容构建一个jquery ajax请求



![](https://s1.ax1x.com/2022/07/30/viHS7n.png)



在浏览器控制台手动测试ajax请求有效性,后台返回回复成功

![](https://s1.ax1x.com/2022/07/30/viHCt0.png)

同时刷新后可看到相应后的资源链接

![vibZ28.png](https://s1.ax1x.com/2022/07/30/vibZ28.png)]

删除评论同发表回复类似

![](https://s1.ax1x.com/2022/07/30/viHPhV.png)







如下完整油猴脚本代码
```js
// ==UserScript==
// @name         盘友社区自动回复
// @namespace    http://tampermonkey.net/
// @version      0.1.2022年7月30日
// @description  盘友社区资源自动评论,首页隐藏失效资源
// @author       熊二最帅
// @license      AGPL License
// @match        https://www.panyoubbs.com/*
// @require      https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery-cookie/1.4.1/jquery.cookie.js
// @icon         https://www.google.com/s2/favicons?sz=64&domain=panyoubbs.com
// @grant        none
// ==/UserScript==


(function () {
    'use strict';


    if ($.cookie('think_token')) {
        if ($(".lose").length === 0 && $('.jm').length && !$('.jm').attr("id")) {
            $.ajax({
                url: "https://www.panyoubbs.com/index/post/reply.html",
                type: "post",
                data: JSON.stringify({
                    content: '感谢',
                    thread_id: $('.thread-post input[name="thread_id"]').val(),
                    user_id: $('.thread-post input[name="user_id"]').val(),
                    quotepid: $('.thread-post input[name="quotepid"]').val(),
                    isfirst: $('.thread-post input[name="isfirst"]').val(),
                    thread_userid: $('.thread-post input[name="thread_userid"]').val(),
                    __token__: $('.thread-post input[name="__token__"]').val(),
                }),
                contentType: 'application/json; charset=UTF-8',
                success: function (data) {
                    console.log(data)
                },
                error: function () {
                    console.log("检查连接");
                }
            });
        }


        for (const argument of document.querySelectorAll(".layui-icon-delete")) {
            //删除评论
            $.ajax({
                url: "https://www.panyoubbs.com/index/thread/replydel",
                type: "post",
                data: JSON.stringify({id: $(argument).parent().attr('pid')}),
                contentType: 'application/json; charset=UTF-8',
                success: function (data) {
                    location.reload();
                },
                error: function () {
                    console.log("检查连接");
                }
            });
        }

    }


    //主页隐藏失效资源
    for (const argument of document.querySelectorAll('.layui-card-body .list')) {
        let args = $(argument).find('.typetag')
        if (args.length > 0) {
            if ($(args).text() === '失效') {
                $(argument).hide()
            }
        }
    }
})();

```

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

Hmily 发表于 2022-8-2 11:42
抱歉,未能达到申请要求,申请不通过,可以关注论坛官方微信(吾爱破解论坛),等待开放注册通知。
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-6 19:48

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表