The println in the following code works (with or without toInt)
println("retweets : ", e.getOrElse("retweets", 0).toInt)
top10Tweets(""+e.get("text").get, e.getOrElse("retweets", 0).toInt)
But when I pass it as an argument of a function (as above), it does not work. It says "value toInt is not a member of Any"
When I remove toInt, it says,
type mismatch;
[error] found : Any
[error] required: Int
e is a Map, as follows,
def tweetDetails(obj: twitter4j.Status) = {
Map(
"id" -> obj.getUser().getId(),
"screenName" -> obj.getUser().getScreenName(),
"text" -> obj.getText(),
"retweets" -> obj.getRetweetCount(),
"mentions" -> obj.getUserMentionEntities().length)
}
signature of top10Tweets,
def top10Tweets(tweets: String, retweet_c: Int, mention_c: Int) = {
}