use of forpdateam.ru.forpda.api.NetworkResponse in project ForPDA by RadiationX.
the class NewsApi method sendPoll.
public DetailsPage sendPoll(String from, int pollId, int[] answersId) throws Exception {
String url = "https://4pda.ru/pages/poll/?act=vote&poll_id=" + pollId;
NetworkRequest.Builder rBuilder = new NetworkRequest.Builder().url(url).multipart().xhrHeader().formHeader("from", from);
for (int i = 0; i < answersId.length; i++) {
rBuilder.formHeader("answer[]", Integer.toString(answersId[i]));
}
NetworkResponse response = Api.getWebClient().request(rBuilder.build());
return parseArticle(response.getBody());
}
use of forpdateam.ru.forpda.api.NetworkResponse in project ForPDA by RadiationX.
the class Qms method getBlackList.
public ArrayList<QmsContact> getBlackList() throws Exception {
NetworkRequest.Builder builder = new NetworkRequest.Builder().url("https://4pda.ru/forum/index.php?act=qms&settings=blacklist").formHeader("xhr", "body");
NetworkResponse response = Api.getWebClient().request(builder.build());
return parseBlackList(response.getBody());
}
use of forpdateam.ru.forpda.api.NetworkResponse in project ForPDA by RadiationX.
the class Qms method getThemesList.
public QmsThemes getThemesList(int id) throws Exception {
NetworkRequest.Builder builder = new NetworkRequest.Builder().url("https://4pda.ru/forum/index.php?act=qms&mid=" + id).formHeader("xhr", "body");
NetworkResponse response = Api.getWebClient().request(builder.build());
return parseThemes(response.getBody(), id);
}
use of forpdateam.ru.forpda.api.NetworkResponse in project ForPDA by RadiationX.
the class Qms method unBlockUsers.
public ArrayList<QmsContact> unBlockUsers(int[] ids) throws Exception {
NetworkRequest.Builder builder = new NetworkRequest.Builder().url("https://4pda.ru/forum/index.php?act=qms&settings=blacklist&xhr=blacklist-form&do=1").formHeader("action", "delete-users");
String strId;
for (int id : ids) {
strId = Integer.toString(id);
builder.formHeader("user-id[".concat(strId).concat("]"), strId);
}
NetworkResponse response = Api.getWebClient().request(builder.build());
checkOperation(response.getBody());
return parseBlackList(response.getBody());
}
use of forpdateam.ru.forpda.api.NetworkResponse in project ForPDA by RadiationX.
the class Qms method blockUser.
public ArrayList<QmsContact> blockUser(String nick) throws Exception {
NetworkRequest.Builder builder = new NetworkRequest.Builder().url("https://4pda.ru/forum/index.php?act=qms&settings=blacklist&xhr=blacklist-form&do=1").formHeader("action", "add-user").formHeader("username", nick);
NetworkResponse response = Api.getWebClient().request(builder.build());
checkOperation(response.getBody());
return parseBlackList(response.getBody());
}
Aggregations