Created
August 28, 2013 11:18
-
-
Save shibafu528/6364955 to your computer and use it in GitHub Desktop.
テストに使ったやつです
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PostTester { | |
public static void main(String[] args) { | |
Twitter twitter = TwitterFactory.getSingleton(); | |
int counter = 0; | |
Random rand = new Random(); | |
while (true) { | |
try { | |
String text = "@null " + String.format("%x", rand.nextLong()); | |
Status status = twitter.updateStatus(text); | |
++counter; | |
System.out.println(counter + "回目: " + status.getText()); | |
//ひとやすみ | |
try { | |
Thread.sleep(1000); | |
} catch (InterruptedException e) { | |
e.printStackTrace(); | |
} | |
} catch (TwitterException e) { | |
e.printStackTrace(); | |
break; | |
} | |
} | |
System.out.println("投稿した回数 :" + counter); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment