[英]twitter4j Streaming tweets
public static void main(String[] args) throws TwitterException, IOException{
StatusListener listener = new StatusListener(){
public void onStatus(Status status) {
System.out.println(status.getUser().getName() + " : " + status.getText());
}
public void onDeletionNotice(StatusDeletionNotice statusDeletionNotice) {}
public void onTrackLimitationNotice(int numberOfLimitedStatuses) {}
public void onException(Exception ex) {
ex.printStackTrace();
}
我正在使用上面的代碼下載流式推文。 我得到這個錯誤。
The type new StatusListener(){} must implement the inherited abstract method StatusListener.onStallWarning(StallWarning)
The type new StatusListener(){} must implement the inherited abstract method StatusListener.onScrubGeo(long, long).
我需要包括任何特定的jar文件嗎?
無需再包含.jar文件,只需包含以下方法
public void onStallWarning(StallWarning arg0) {
}
您的代碼將編譯並成功運行。
希望這可以幫助!!!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.