use of me.yluo.ruisiapp.model.WaterData in project Ruisi by freedom10086.
the class FrageForums method initForums.
void initForums(boolean loginstate) {
new GetForumList().execute(loginstate);
if (App.IS_SCHOOL_NET) {
// 是校园网
String url = App.BASE_URL_RS + "forum.php";
HttpUtil.get(url, new ResponseHandler() {
@Override
public void onSuccess(byte[] response) {
List<WaterData> temps = new ArrayList<>();
Document doc = Jsoup.parse(new String(response));
Elements waters = doc.select("#portal_block_317").select("li");
for (Element e : waters) {
Elements es = e.select("p").select("a[href^=home.php?mod=space]");
String uid = GetId.getId("uid=", es.attr("href"));
String imgSrc = e.select("img").attr("src");
String uname = es.text();
int num = 0;
if (e.select("p").size() > 1) {
if (e.select("p").get(1).text().contains("帖数")) {
num = GetId.getNumber(e.select("p").get(1).text());
}
}
temps.add(new WaterData(uname, uid, num, imgSrc));
if (temps.size() >= 16)
break;
}
if (temps.size() > 0)
adapter.setWaterData(temps);
}
});
}
}