简体   繁体   English

twitter4j流推文

[英]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();
}

I am using the above code to download streaming tweets. 我正在使用上面的代码下载流式推文。 I get this error . 我得到这个错误。

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).

Do I need to include any specific jar file? 我需要包括任何特定的jar文件吗?

No need to include any more .jar files, only include the method below 无需再包含.jar文件,只需包含以下方法

        public void onStallWarning(StallWarning arg0) {
        }

Your code will compile and run successfully. 您的代码将编译并成功运行。

Hope this helps!!! 希望这可以帮助!!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM