贴吧工具集
2018年12月22日 创建项目
2019年 3月 4日 查回帖失效
@Test
void testLogin() {
TBUser tbUser = new TBUser(BDUSSD);
System.out.println(tbUser.getUid() + tbUser.getUserName());
}
@Test
void testSign() {
TBUser tbUser = new TBUser(BDUSSNoName);
tbUser.updateForumList();
tbUser.Sign();
}
void testPostAdd() {
TBUser user = new TBUser(BDUSS);
user.reply("回复内容", "帖子所在贴吧", "帖子地址");
}
@Test
void testSeeTie() {
UserForumsInfo otherForumList = client.getOtherForumList("用户名", "1(查看第几页)");
System.out.println(new Gson().toJson(otherForumList));
}
@Test
void intoAForum() {
ThreadRecord[] records = client.intoAForum("bug", "1");
System.out.println(new Gson().toJson(records));
}
@Test
void reply() {
while (true) {
test("抗压");
}
}
private void test(String name) {
ThreadRecord[] records = client.intoAForum(name, "1");
for (int i=0; i<records.length; i++) {
if (records[i].getReplyNum() == 0) {
String tlRes = Tuling.send(records[i].getTitle());
String out = new JsonParser().parse(tlRes).getAsJsonObject().get("text").getAsString();
// 只回复性别是女的
if (records[i].getSex() == 2) {
client.postAdd(BDUSS, out, name, records[i].getTid());
System.out.println("回复:" + records[i].getTitle());
}
return;
}
}
}
@Test
void seeAThread() {
String res = client.seeAThread("5983121478", "123305989467");
System.out.println(res);
}
@Test
void seePost(){
HttpClient client = new HttpClient();
ReplyRecord[] records = client.getUserPost("","一帮坑玩LOL", "1");
System.out.println(new Gson().toJson(records));
}
@Test
void testLikeForum() {
// 1 是关注; 否则是取关
client.likeOrUnfavoForum(BDUSS, "bug", 1);
}
@Test
void testClone() {
TBUser user = new TBUser(BDUSS);
user.cloneForums("弄死楼主");
}
@Test
void test() {
ArrayList<String> fuckStrs = new ArrayList<>();
boolean flag = true;
int pn = 1;
while (flag) {
String res = client.seeAFloor("5987855969", "123374470750", String.valueOf(pn), 1);
ArrayList<String> supPosts = JsonUtils.subPostsParser(res, "学医无法救主C");
if (supPosts != null) {
for (int i=0; i<supPosts.size(); i++) {
if (!fuckStrs.contains(supPosts.get(i))) {
fuckStrs.add(supPosts.get(i));
}
}
pn++;
} else {
flag = false;
}
}
System.out.println(new Gson().toJson(fuckStrs));
System.out.println(fuckStrs.size());
}