I am using Twitter4j for fetching trends from Twitter using the following code:
val twitter = new TwitterFactory().getInstance
val twitterStream = new TwitterStreamFactory().getInstance
twitterStream.addListener(simpleStatusListener)
val trends = twitter.getTrends
println(trends.getName)
I tried different methods for getting trends but I keep getting the following error:
value getTrends is not a member of twitter4j.Twitter
Can someone point out what is wrong?
That method was removed from twitter4j
and subsequently from the examples. Take a look at other trends-related methods that are currently supported .
The author has many other, up-to-date, examples here .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.