@Test public void getRaw() throws Exception { twitterCrawler.configureTwitterAuthentication(); setHashTags(); List<TweetBundle> rawData = twitterCrawler.getRaw(); assertTrue(rawData.size() > 0); assertTrue(!rawData.get(0).getHashTag().equals("")); assertTrue(rawData.get(0).getTweets().size() != 0); }
@Override List<TweetBundle> getRaw() { logger.info("Started getting tweets from twitter"); List<TweetBundle> tweetBundles = new ArrayList(); for (int i = 0; i < hashTags.length; i++) { hashTag = hashTags[i]; Query query = new Query(hashTag); query.count(LOAD_TWEETS_PER_HASTAG); try { QueryResult result = twitter.search(query); TweetBundle rawTweets = new TweetBundle(hashTag); List<Status> rawData = result.getTweets(); rawTweets.addTweets(rawData); tweetBundles.add(rawTweets); logger.info("Received total of " + rawTweets.getTweets() .size() + " tweets from twitter with " + hashTag); } catch (TwitterException e) { logger.error("TwitterException: " + e.getErrorMessage()); } } return tweetBundles; }
TwitterCrawler extends Crawler<TweetBundle> { @Override List<TweetBundle> getRaw() { logger.info("Started getting tweets from twitter"); List<TweetBundle> tweetBundles = new ArrayList(); for (int i = 0; i < hashTags.length; i++) { hashTag = hashTags[i]; Query query = new Query(hashTag); query.count(LOAD_TWEETS_PER_HASTAG); try { QueryResult result = twitter.search(query); TweetBundle rawTweets = new TweetBundle(hashTag); List<Status> rawData = result.getTweets(); rawTweets.addTweets(rawData); tweetBundles.add(rawTweets); logger.info("Received total of " + rawTweets.getTweets() .size() + " tweets from twitter with " + hashTag); } catch (TwitterException e) { logger.error("TwitterException: " + e.getErrorMessage()); } } return tweetBundles; } }
TwitterCrawler extends Crawler<TweetBundle> { @Override List<TweetBundle> getRaw() { logger.info("Started getting tweets from twitter"); List<TweetBundle> tweetBundles = new ArrayList(); for (int i = 0; i < hashTags.length; i++) { hashTag = hashTags[i]; Query query = new Query(hashTag); query.count(LOAD_TWEETS_PER_HASTAG); try { QueryResult result = twitter.search(query); TweetBundle rawTweets = new TweetBundle(hashTag); List<Status> rawData = result.getTweets(); rawTweets.addTweets(rawData); tweetBundles.add(rawTweets); logger.info("Received total of " + rawTweets.getTweets() .size() + " tweets from twitter with " + hashTag); } catch (TwitterException e) { logger.error("TwitterException: " + e.getErrorMessage()); } } return tweetBundles; } TwitterCrawler(); }
TwitterCrawler extends Crawler<TweetBundle> { @Override List<TweetBundle> getRaw() { logger.info("Started getting tweets from twitter"); List<TweetBundle> tweetBundles = new ArrayList(); for (int i = 0; i < hashTags.length; i++) { hashTag = hashTags[i]; Query query = new Query(hashTag); query.count(LOAD_TWEETS_PER_HASTAG); try { QueryResult result = twitter.search(query); TweetBundle rawTweets = new TweetBundle(hashTag); List<Status> rawData = result.getTweets(); rawTweets.addTweets(rawData); tweetBundles.add(rawTweets); logger.info("Received total of " + rawTweets.getTweets() .size() + " tweets from twitter with " + hashTag); } catch (TwitterException e) { logger.error("TwitterException: " + e.getErrorMessage()); } } return tweetBundles; } TwitterCrawler(); @Override void crawl(); List<Post> rawToPosts(TweetBundle tweets); }
TwitterCrawler extends Crawler<TweetBundle> { @Override List<TweetBundle> getRaw() { logger.info("Started getting tweets from twitter"); List<TweetBundle> tweetBundles = new ArrayList(); for (int i = 0; i < hashTags.length; i++) { hashTag = hashTags[i]; Query query = new Query(hashTag); query.count(LOAD_TWEETS_PER_HASTAG); try { QueryResult result = twitter.search(query); TweetBundle rawTweets = new TweetBundle(hashTag); List<Status> rawData = result.getTweets(); rawTweets.addTweets(rawData); tweetBundles.add(rawTweets); logger.info("Received total of " + rawTweets.getTweets() .size() + " tweets from twitter with " + hashTag); } catch (TwitterException e) { logger.error("TwitterException: " + e.getErrorMessage()); } } return tweetBundles; } TwitterCrawler(); @Override void crawl(); List<Post> rawToPosts(TweetBundle tweets);  }