Package twitter4j

Examples of twitter4j.Status


         return;
      }

      for (int i = res.size() - 1; i >= 0; i--)
      {
         Status status = (Status) res.get(i);

         ServerMessage msg = new ServerMessageImpl(this.storageManager.generateUniqueID(),
                                                   TwitterConstants.INITIAL_MESSAGE_BUFFER_SIZE);
         msg.setAddress(new SimpleString(this.queueName));
         msg.setDurable(true);
         msg.encodeMessageIDToBuffer();

         putTweetIntoMessage(status, msg);

         this.postOffice.route(msg, false);
         HornetQTwitterLogger.LOGGER.debug(connectorName + ": routed: " + status.toString());
      }

      this.paging.setSinceId(((Status) res.get(0)).getId());
      HornetQTwitterLogger.LOGGER.debug(connectorName + ": update latest ID: " + this.paging.getSinceId());
   }
View Full Code Here


        twitter.setOAuthConsumer(
                settings.get("river.twitter.oauth.consumer_key"),
                settings.get("river.twitter.oauth.consumer_secret"));
        twitter.setOAuthAccessToken(accessToken);

        Status status = twitter.updateStatus("testing twitter river. Please ignore. " +
                        DateTime.now().toString());
        logger.info("  -> tweet [{}] sent: [{}]", status.getId(), status.getText());

        assertThat(awaitBusy(new Predicate<Object>() {
            public boolean apply(Object obj) {
                try {
                    refresh();
View Full Code Here

        }
      }
    }
    // persist to the accessToken for future reference.
    storeAccessToken(twitter.verifyCredentials().getId(), accessToken);
    Status status = twitter.updateStatus(args[0]);
    System.out.println("Successfully updated the status to ["
        + status.getText() + "].");
    System.exit(0);
  }
View Full Code Here

   
    if(txt.length() > 140) {
      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

    try {
      // abbreviate the Tweet to meet the 140 character limit ...
      tweetTxt = StringUtils.abbreviate(tweetTxt, CHARACTER_LIMIT);
      // send the Tweet
      Status status = client.updateStatus(tweetTxt);
      logger.debug("Successfully sent Tweet '{}'", status.getText());
      return true;
    } catch (TwitterException e) {
      logger.error("Failed to send Tweet '" + tweetTxt + "' because of: " + e.getLocalizedMessage());
      return false;
    }
View Full Code Here

        }
    }
   
    public void sendTwitt(){
        try {
            Status s = twitter.updateStatus(message);
            messageContext.add("Postado no  Twitter: " + s.getText(), SeverityType.INFO);
        } catch (TwitterException ex) {
            messageContext.add(ex.getMessage(), SeverityType.ERROR);
        }
    }
View Full Code Here

            System.out.println("Usage: java twitter4j.examples.tweets.ShowStatus [status id]");
            System.exit(-1);
        }
        try {
            Twitter twitter = new TwitterFactory().getInstance();
            Status status = twitter.showStatus(Long.parseLong(args[0]));
            System.out.println("@" + status.getUser().getScreenName() + " - " + status.getText());
            System.exit(0);
        } catch (TwitterException te) {
            te.printStackTrace();
            System.out.println("Failed to show status: " + te.getMessage());
            System.exit(-1);
View Full Code Here

                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();
            System.out.println("Failed to update status: " + te.getMessage());
            System.exit(-1);
View Full Code Here

                if (!twitter.getAuthorization().isEnabled()) {
                    System.out.println("OAuth consumer key/secret is not set.");
                    System.exit(-1);
                }
            }
            Status status = twitter.updateStatus(args[0]);
            System.out.println("Successfully updated the status to [" + status.getText() + "].");
            System.exit(0);
        } catch (TwitterException te) {
            te.printStackTrace();
            System.out.println("Failed to get timeline: " + te.getMessage());
            System.exit(-1);
View Full Code Here

                    return name.endsWith(".json");
                }
            });
            for (File file : files) {
                String rawJSON = readFirstLine(file);
                Status status = TwitterObjectFactory.createStatus(rawJSON);
                System.out.println("@" + status.getUser().getScreenName() + " - " + status.getText());
            }
            System.exit(0);
        } catch (IOException ioe) {
            ioe.printStackTrace();
            System.out.println("Failed to store tweets: " + ioe.getMessage());
View Full Code Here

TOP

Related Classes of twitter4j.Status

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.