scala - trying to stream tweets with twitter4j3.0.3 -


i trying stream tweets twitter4j3.0.3 scala gives me these errors. here code:

   import twitter4j._    import ch.qos.logback.core.status.statuslistener    import twitter4j.conf.configurationbuilder    import ch.qos.logback.core.status     object stream {      def main(args: array[string]) {   val cb: configurationbuilder = new configurationbuilder   cb.setdebugenabled(true)    .setoauthconsumerkey("1")    .setoauthconsumersecret("1")    .setoauthaccesstoken("1")    .setoauthaccesstokensecret("1")   def simplestatuslistener:statuslistener =new statuslistener() {   def addstatusevent(status: status) {println(x = status.gettext)}     def onstatus(status: status) { println(x = status.gettext) }   def ondeletionnotice(statusdeletionnotice: statusdeletionnotice) {}   def ontracklimitationnotice(numberoflimitedstatuses: int) {}   def onexception(ex: exception) { ex.printstacktrace }   def onscrubgeo(arg0: long, arg1: long) {}   def onstallwarning(warning: stallwarning) {}   }   val twitterstream:twitterstream= new twitterstreamfactory(cb.build).getinstance()   twitterstream.addlistener(simplestatuslistener)  twitterstream.sample()  }  } 

and error: overloaded method value addlistener alternatives: (twitter4j.rawstreamlistener)unit (twitter4j.sitestreamslistener)unit (twitter4j.statuslistener)unit (twitter4j.userstreamlistener)unit cannot applied (ch.qos.logback.core.status.statuslistener) twitterstream.addlistener(simplestatuslistener) ^

you're importing wrong statuslistener interface. instead of

import ch.qos.logback.core.status.statuslistener

you need

import twitter4j.statuslistener


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -