public static String[] constructIds(Response res) throws WeiboException { try { JSONArray list = res.asJSONObject().getJSONArray("ids"); String temp = list.toString().substring(1, list.toString().length() - 2); String[] ids = temp.split(","); return ids; } catch (JSONException jsone) { throw new WeiboException(jsone); } catch (WeiboException te) { throw te; } }
public static void main(String[] args) { String access_token = args[0]; Suggestion suggestion = new Suggestion(access_token); try { JSONArray jo = suggestion.suggestionsUsersMayInterested(); System.out.println(jo.toString()); } catch (WeiboException e) { e.printStackTrace(); } }
public static void main(String[] args) { String access_token = args[0]; String q = args[1]; Search search = new Search(access_token); try { JSONArray jo = search.searchSuggestionsCompanies(q); System.out.println(jo.toString()); } catch (WeiboException e) { e.printStackTrace(); } }
public static void main(String[] args) { String access_token = args[0]; Weibo weibo = new Weibo(); weibo.setToken(access_token); String uids = args[1]; Users um = new Users(); try { JSONArray user = um.getUserCount(uids); Log.logInfo(user.toString()); } catch (WeiboException e) { e.printStackTrace(); } }