誰かが面白かったら、私はついに見つけました。
Twitter4jで:
public JSONObject GetListCollections(String user_id) throws TwitterException, IOException, JSONException {
// GET Collection list, https://api.twitter.com/1.1/collections/list.json?user_id= (ou screen_name=)
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setHttpProxyHost(Constant.ProxyHost);
cb.setHttpProxyPort(Constant.ProxyPort);
cb.setOAuthConsumerKey(Constant.consumerkey);
cb.setOAuthConsumerSecret(Constant.consumerSecret);
cb.setOAuthAccessToken(Constant.accessToken);
cb.setOAuthAccessTokenSecret(Constant.accessTokenSecret);
Configuration conf = cb.build();
HttpClient HC = HttpClientFactory.getInstance(conf.getHttpClientConfiguration());
HttpParameter[] HPs = {new HttpParameter("user_id",user_id)};
Authorization A = new OAuthAuthorization(conf);
HttpResponseListener HRL = new HttpResponseListener(){
@Override
public void httpResponseReceived(HttpResponseEvent event) {
System.out.println(event.isAuthenticated()+"\n"+event.getRequest()+"\n"+event.getResponse());
}
};
HttpResponse HR = HC.get("https://api.twitter.com/1.1/collections/list.json",HPs, A, HRL);
System.out.println("HR.getStatusCode = "+HR.getStatusCode());
return HR.asJSONObject();
}