Twitter4J 是一个非官方的 Twitter API 的 Java 客户端开发包,使用 Twitter4j 可以轻松在你的应用中集成 Twitter 的服务,主要特点:
示例代码:
// Creates the main object
Twitter twitter = new TwitterFactory().getInstance();
// Ask for a request token
RequestToken requestToken = twitter.getOAuthRequestToken();
// Store the token in session
request.getSession().setAttribute("rt", requestToken);
// Extract the authentication URL
String authUrl = requestToken.getAuthenticationURL();
// Send the Twitter authentication page to the page to create a popup from there
request.setAttribute("auth", authUrl);
开发语言: java
授权协议:Apache