Package twitter4j

Examples of twitter4j.GeoLocation


  }
 
  private void updateTwitter() throws TwitterException
  {
      Twitter twitter = new TwitterFactory().getInstance(this.twitt.getAutor(),this.passwd);
      twitter.updateStatus(this.twitt.getMensagem(),new GeoLocation(this.twitt.getLocation().getY(),this.twitt.getLocation().getX()));   
  }
View Full Code Here


                        String title = "<img src=\"" + follower.getProfileImageURL().toString() + "\" />" + follower.getScreenName();
                        String alternate = follower.getProfileImageURL().toString();
                        String id = follower.getScreenName();
                        String updated = follower.getCreatedAt().toString();
                        String summary = follower.getDescription();
                        GeoLocation geo = follower.getStatus().getGeoLocation();
                        String lon = Double.toString(geo.getLongitude());
                        String lat = Double.toString(geo.getLatitude());
                        out.println(String.format(template, title, alternate, id, updated, summary, lon, lat));
                    }
                }
            }
View Full Code Here

        System.out.println(result.getMaxId() + " :" + result.getPage());
        for (Tweet tweet : result.getTweets()) {           
            User user = twitter.showUser(tweet.getFromUser());
            System.out.println(user.getLocation());
            if (user.isGeoEnabled()) {
                GeoLocation geo = user.getStatus() != null ? user.getStatus().getGeoLocation() : null;
                System.out.println(geo + ":" + tweet.getLocation() + ":" + tweet.getFromUser() + ":" + tweet.getText());
            }
        }

    }
View Full Code Here

                        String title = "<img src=\"" +  status.getUser().getProfileImageURL().toString() + "\" />" +  status.getUser().getScreenName();
                        String alternate = status.getUser().getProfileImageURL().toString();
                        String id =  status.getUser().getScreenName();
                        String updated =  status.getUser().getCreatedAt().toString();
                        String summary =  status.getText();
                        GeoLocation geo = status.getGeoLocation();
                        String lon = Double.toString(geo.getLongitude());
                        String lat = Double.toString(geo.getLatitude());
                        out.println(String.format(template, title, alternate, id, updated, summary, lon, lat));
                   
                }
           
View Full Code Here

                JSONObject geometryJSON = json.getJSONObject("geometry");
                geometryType = getRawString("type", geometryJSON);
                JSONArray array = geometryJSON.getJSONArray("coordinates");
                if (geometryType.equals("Point")) {
                    geometryCoordinates = new GeoLocation[1][1];
                    geometryCoordinates[0][0] = new GeoLocation(array.getDouble(0), array.getDouble(1));
                } else if (geometryType.equals("Polygon")) {
                    geometryCoordinates = z_T4JInternalJSONImplFactory.coordinatesAsGeoLocationArray(array);
                } else {
                    // MultiPolygon currently unsupported.
                    geometryType = null;
View Full Code Here

                                    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;
View Full Code Here

         if (message.containsProperty(TwitterConstants.KEY_GEO_LOCATION_LATITUDE))
         {
            double geolat = message.getDoubleProperty(TwitterConstants.KEY_GEO_LOCATION_LATITUDE);
            double geolong = message.getDoubleProperty(TwitterConstants.KEY_GEO_LOCATION_LONGITUDE);
            status.setLocation(new GeoLocation(geolat, geolong));
         }

         if (message.containsProperty(TwitterConstants.KEY_PLACE_ID))
         {
            status.setPlaceId(message.getStringProperty(TwitterConstants.KEY_PLACE_ID));
View Full Code Here

      msg.putLongProperty(TwitterConstants.KEY_IN_REPLY_TO_STATUS_ID, status.getInReplyToStatusId());
      msg.putIntProperty(TwitterConstants.KEY_IN_REPLY_TO_USER_ID, status.getInReplyToUserId());
      msg.putBooleanProperty(TwitterConstants.KEY_IS_FAVORITED, status.isFavorited());
      msg.putBooleanProperty(TwitterConstants.KEY_IS_RETWEET, status.isRetweet());
      msg.putObjectProperty(TwitterConstants.KEY_CONTRIBUTORS, status.getContributors());
      GeoLocation gl;
      if ((gl = status.getGeoLocation()) != null)
      {
         msg.putDoubleProperty(TwitterConstants.KEY_GEO_LOCATION_LATITUDE, gl.getLatitude());
         msg.putDoubleProperty(TwitterConstants.KEY_GEO_LOCATION_LONGITUDE, gl.getLongitude());
      }
      Place place;
      if ((place = status.getPlace()) != null)
      {
         msg.putStringProperty(TwitterConstants.KEY_PLACE_ID, place.getId());
View Full Code Here

TOP

Related Classes of twitter4j.GeoLocation

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.