@Override protected List<Tweet> pollForTweets(long sinceId) { SearchParameters searchParameters = new SearchParameters(query).count(this.getPageSize()).sinceId(sinceId); SearchResults results = this.getTwitter().searchOperations().search(searchParameters); return (results != null) ? results.getTweets() : Collections.<Tweet>emptyList(); }
@RequestMapping("/result") public String hello(@RequestParam(defaultValue = "slawomir_krupa") String search, Model model) { // model.addAttribute("message","Hello" + userName); SearchResults searchResults = twitter.searchOperations().search(search); // List<String> tweets = List<Tweet> tweets = searchResults.getTweets(); // .stream() // .map(Tweet::getText) // .collect(Collectors.toList()); model.addAttribute("tweets", tweets); model.addAttribute("search", search); // model.addAttribute("message", text); return "resultPage"; }