SOUL私信脚本,soul自动聊天脚本,群发插件java版

简介: Soul平台的自动聊天和群发功能,包含HTTP请求、多线程处理、随机消息生成等功能模块。

Soul平台的自动聊天和群发功能,包含HTTP请求、多线程处理、随机消息生成等功能模块。
下载地址:http://m.pan38.com/download.php?code=GESEMI 提取码:6666

import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Random;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

public class SoulAutoChat {
private static final String API_URL = "https://api.soul.com/chat/send";
private static final String[] GREETINGS = {"你好呀", "在干嘛呢", "今天过得怎么样", "很高兴认识你"};
private static final String[] RESPONSES = {"我也是", "真的吗", "好有趣", "继续说说"};

private String authToken;
private ScheduledExecutorService scheduler;

public SoulAutoChat(String token) {
    this.authToken = token;
    this.scheduler = Executors.newScheduledThreadPool(5);
}

public void startAutoChat(String targetUserId) {
    scheduler.scheduleAtFixedRate(() -> {
        try {
            String message = generateRandomMessage();
            sendChatMessage(targetUserId, message);
            Thread.sleep(2000 + new Random().nextInt(3000));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }, 0, 5, TimeUnit.SECONDS);
}

private String generateRandomMessage() {
    Random rand = new Random();
    if (rand.nextBoolean()) {
        return GREETINGS[rand.nextInt(GREETINGS.length)];
    } else {
        return RESPONSES[rand.nextInt(RESPONSES.length)];
    }
}

private void sendChatMessage(String userId, String message) throws Exception {
    CloseableHttpClient client = HttpClients.createDefault();
    HttpPost post = new HttpPost(API_URL);

    JSONObject json = new JSONObject();
    json.put("recipient_id", userId);
    json.put("message", message);
    json.put("token", authToken);

    post.setEntity(new StringEntity(json.toString()));
    post.setHeader("Content-type", "application/json");

    client.execute(post);
    client.close();
}

public void shutdown() {
    scheduler.shutdown();
}

}

import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.json.JSONArray;
import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class GroupMessageSender {
private static final String GROUP_API = "https://api.soul.com/group/send";
private static final int THREAD_POOL_SIZE = 10;

private String authToken;
private ExecutorService executor;

public GroupMessageSender(String token) {
    this.authToken = token;
    this.executor = Executors.newFixedThreadPool(THREAD_POOL_SIZE);
}

public void sendToGroup(List<String> userIds, String message) {
    for (String userId : userIds) {
        executor.execute(() -> {
            try {
                sendSingleMessage(userId, message);
                Thread.sleep(1000); // 防止发送过快
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
    }
}

public List<String> loadUserIdsFromFile(String filePath) throws Exception {
    List<String> userIds = new ArrayList<>();
    try (BufferedReader br = new BufferedReader(new FileReader(filePath))) {
        String line;
        while ((line = br.readLine()) != null) {
            userIds.add(line.trim());
        }
    }
    return userIds;
}

private void sendSingleMessage(String userId, String message) throws Exception {
    CloseableHttpClient client = HttpClients.createDefault();
    HttpPost post = new HttpPost(GROUP_API);

    JSONObject json = new JSONObject();
    json.put("user_ids", new JSONArray().put(userId));
    json.put("message", message);
    json.put("token", authToken);

    post.setEntity(new StringEntity(json.toString()));
    post.setHeader("Content-type", "application/json");

    client.execute(post);
    client.close();
}

public void shutdown() {
    executor.shutdown();
}

}

java.util.Arrays;
import java.util.List;

public class MainApp {
public static void main(String[] args) {
// 自动聊天示例
SoulAutoChat chatBot = new SoulAutoChat("your_auth_token_here");
chatBot.startAutoChat("target_user_id");

    // 群发消息示例
    GroupMessageSender sender = new GroupMessageSender("your_auth_token_here");
    try {
        List<String> userIds = Arrays.asList(
            "user1", "user2", "user3", "user4", "user5"
        );
        sender.sendToGroup(userIds, "大家好,这是我的群发测试消息!");
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        // 关闭服务
        chatBot.shutdown();
        sender.shutdown();
    }
}

}

相关文章
SOUL私信群发工具,全自动关注点赞私信脚本,无限制按键深度定制版
这是一款针对SOUL平台开发的自动化营销脚本,可通过模拟用户行为实现批量私信功能,帮助将流量导入私域并转化。脚本支持自定义搜索关键词
|
小程序
小程序踩坑:Setting data field "xxxx" to undefined is invalid.
小程序踩坑:Setting data field "xxxx" to undefined is invalid.
563 0
|
应用服务中间件 nginx 数据安全/隐私保护
nginx中session ticket重用Session提高https性能分析
使用session ticket机制可以提高ssl握手的效率,并节约有效的服务器计算资源
15990 0
|
4月前
|
传感器 API Android开发
雷电模拟器防检测工具, 模拟器防检测 伪装手机,安卓模拟器防检测工具
硬件特征检测通过CPUID指令和显卡信息判断虚拟环境110 系统环境检测通过查找模拟器特有文件和进程112
|
4月前
|
Shell 数据安全/隐私保护 Python
微信虚拟摄像头插件,QQ虚拟相机拍摄录像工具,替换虚拟视频聊天软件
完整的虚拟摄像头实现方案,包含多个模块的代码实现。这个项目可以模拟摄像头设备,并在微信/QQ视频
微信qq陌陌soul,虚拟视频聊天插件,xposed摄像头替换工具
包含三个核心模块:虚拟摄像头服务、视频处理引擎和Xposed框架集成。
|
4月前
|
iOS开发
苹果虚拟视频替换摄像头, iOS虚拟视频免费插件, iphone虚拟摄像头插件
AutoJS脚本实现了抖音直播间的自动互动功能,包括持续点赞、关注主播和收藏商品。代码中包含了详细
|
5月前
|
JSON 安全 定位技术
微信附近人提取v3脚本, 微信附近人id提取技术插件,采集附近人wxid数据工具
本内容介绍微信“附近的人”功能的技术原理与实现方法,基于LBS服务,涉及位置模拟、协议分析及数据解析。通过修改GPS坐标或使用Frida等工具hook位置函数
|
缓存 监控 测试技术
php-fpm优化调优
php-fpm优化调优
318 4
|
应用服务中间件 网络安全 nginx
运维专题.Docker+Nginx服务器的SSL证书安装
运维专题.Docker+Nginx服务器的SSL证书安装
887 3