예제 #1
0
  public void postQuote() {

    String quote = SentenceGenerator.generateSentence();

    while (quote.length() > 140) {
      quote = SentenceGenerator.generateSentence();
    }

    try {
      TweetFunctions.tweet(quote);

      for (int i = 0; i < 150; i++) {
        quote += " ";
      }

      quote = quote.substring(0, 145);

      writeToLog("Successfuly updated to: \"" + quote + "\"");
    } catch (TwitterException e) {

      for (int i = 0; i < 150; i++) {
        quote += " ";
      }

      quote = quote.substring(0, 145);

      writeToLog("Failed to Post: \"" + quote + "\" BECAUSE: " + e.getMessage());
    }
  }