Skip to content

Instantly share code, notes, and snippets.

@shibafu528
Created August 28, 2013 11:18
Show Gist options
  • Save shibafu528/6364955 to your computer and use it in GitHub Desktop.
Save shibafu528/6364955 to your computer and use it in GitHub Desktop.
テストに使ったやつです
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