50,523
社区成员
发帖
与我相关
我的任务
分享
/**
* 发送消息
*/
public static void sendMsg(Map<String, String> cookie, String content,
String fakeId) throws IOException {
HashMap<String, String> map = new HashMap<String, String>();
map.put("tofakeid", fakeId);
map.put("content", content);
map.put("error", "false");
map.put("token", TOKEN);
map.put("type", "1");
map.put("ajax", "1");
String referrerUrl = "https://mp.weixin.qq.com/cgi-bin/singlesendpage?t=message/send&action=index&tofakeid="+fakeId+"&token="+TOKEN+"&lang=zh_CN";
Document document = Jsoup.connect(SEND_MSG).header(USER_AGENT_H, USER_AGENT).header(REFERER_H, INDEX_URL2).referrer(referrerUrl).data(map).cookies(cookie)
.post();
Element body = document.body();
document.hashCode();
document.hasText();
System.out.println(body.text());
}
system.printf("--微号帮-微信公众号营销助手可以设置这个回复文字,还有图文等等。设置图文可以带自己的链接非常个性");