Package twitter4j

Examples of twitter4j.StatusUpdate


      {
         ref.handled();

         ServerMessage message = ref.getMessage();

         StatusUpdate status = new StatusUpdate(message.getBodyBuffer().readString());

         // set optional property

         if (message.containsProperty(TwitterConstants.KEY_IN_REPLY_TO_STATUS_ID))
         {
            status.setInReplyToStatusId(message.getLongProperty(TwitterConstants.KEY_IN_REPLY_TO_STATUS_ID));
         }

         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));
         }

         if (message.containsProperty(TwitterConstants.KEY_DISPLAY_COODINATES))
         {
            status.setDisplayCoordinates(message.getBooleanProperty(TwitterConstants.KEY_DISPLAY_COODINATES));
         }

         // send to Twitter
         try
         {
View Full Code Here


      throw new ScriptusRuntimeException("tweet > 140 characters: "+txt);
    }
   
    Status s;
    try {
      s = twitter.updateStatus(new StatusUpdate(txt));
    } catch (TwitterException e) {
      throw new ScriptusRuntimeException(e);
    }
    return s.getId();
  }
View Full Code Here

                        + ", w=" + media.getImageWidth() + ", h=" + media.getImageHeight()
                        + ", type=" + media.getImageType() + ", size=" + media.getSize());
                mediaIds[i-1] = media.getMediaId();
            }
           
            StatusUpdate update = new StatusUpdate(args[0]);
            update.setMediaIds(mediaIds);
            Status status = twitter.updateStatus(update);
            System.out.println("Successfully updated the status to [" + status.getText() + "][" + status.getId() + "].");
            System.exit(0);
        } catch (TwitterException te) {
            te.printStackTrace();
View Full Code Here

        twitter = new TwitterFactory(conf).getInstance(oauth);
    }

    @Override
    public String upload(File image, String message) throws TwitterException {
        return twitter.updateStatus(new StatusUpdate(message).media(image)).getText();
    }
View Full Code Here

        return twitter.updateStatus(new StatusUpdate(message).media(image)).getText();
    }

    @Override
    public String upload(File image) throws TwitterException {
        return twitter.updateStatus(new StatusUpdate("").media(image)).getText();
    }
View Full Code Here

        return twitter.updateStatus(new StatusUpdate("").media(image)).getText();
    }

    @Override
    public String upload(String imageFileName, InputStream imageBody) throws TwitterException {
        return twitter.updateStatus(new StatusUpdate("").media(imageFileName, imageBody)).getText();
    }
View Full Code Here

        return twitter.updateStatus(new StatusUpdate("").media(imageFileName, imageBody)).getText();
    }

    @Override
    public String upload(String imageFileName, InputStream imageBody, String message) throws TwitterException {
        return twitter.updateStatus(new StatusUpdate(message).media(imageFileName, imageBody)).getText();
    }
View Full Code Here

TOP

Related Classes of twitter4j.StatusUpdate

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.