Package twitter4j

Examples of twitter4j.Query


   * (non-Javadoc)
   * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
   */
  public void start(BundleContext context) throws Exception {
    Twitter twitter = new Twitter();
    Query query = new Query("from:theasf");
   
    try {
      QueryResult result = twitter.search(query);
        List<Tweet> tweets = result.getTweets();
        System.out.println("hits:" + tweets.size());
View Full Code Here


    }

    public synchronized void search(final String term,
                                    final GeoDisc geo,
                                    final Handler<Tweet> handler) throws TwitterClientException, HandlerException {
        Query query = new Query(term);
        query.setCount(MAX_SEARCH_COUNT);

        if (null != geo) {
            GeoLocation loc = new GeoLocation(geo.getLatitude(), geo.getLongitude());
            query.setGeoCode(loc, geo.getRadius(), Query.KILOMETERS);
        }

        QueryResult result = null;

        do {
View Full Code Here

  public static void searchTweets()
  {
      // The factory instance is re-useable and thread safe.
      twitter = new TwitterFactory().getInstance();
     
      Query query = new Query("CLOUD JBOSS");
      QueryResult result;
    try {
      result = twitter.search(query);
      System.out.println("hits:" + result.getCompletedIn());
          for (Tweet tweet : result.getTweets()) {
View Full Code Here

    }

    public List<Status> pollConsume() throws TwitterException {
       
        String keywords = te.getProperties().getKeywords();
        Query query = new Query(keywords);
        if (te.getProperties().isFilterOld()) {
            query.setSinceId(lastId);
        }
       
        LOG.debug("Searching twitter with keywords: {}", keywords);
        return search(query);
    }
View Full Code Here

       
        String keywords = te.getProperties().getKeywords();
        if (keywords == null || keywords.trim().length() == 0) {
            return Collections.emptyList();
        }
        Query query = new Query(keywords);
       
        LOG.debug("Searching twitter with keywords: {}", keywords);
        return search(query);
    }
View Full Code Here

TOP

Related Classes of twitter4j.Query

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.