use of weibo4j.org.json.JSONArray in project twitter-2-weibo by rjyo.
the class UserTrend method constructTrendList.
public static List<UserTrend> constructTrendList(Response res) throws WeiboException {
try {
JSONArray list = res.asJSONArray();
int size = list.length();
List<UserTrend> trends = new ArrayList<UserTrend>(size);
for (int i = 0; i < size; i++) {
trends.add(new UserTrend(list.getJSONObject(i)));
}
return trends;
} catch (JSONException jsone) {
throw new WeiboException(jsone);
} catch (WeiboException te) {
throw te;
}
}
Aggregations