@@ -0,0 +1,2675 @@
+/* author: nur tri wibowo (nordskriving.wordpress.com - github.com/xntwx)%0A * %0A * nrdtweeting.java%0A * ----------------%0A * Simple code for tweeting written in java.%0A * %0A*/%0A%0A//import library%0Aimport java.io.*;%0Aimport java.util.Scanner;%0A%0Aimport twitter4j.*;%0Aimport twitter4j.auth.AccessToken;%0A%0Apublic class nrdtweeting%7B%0A  %0A  public static void main(String%5B%5D args)%7B%0A    //the key enter yours.%0A    %0A    //api key%0A    String aKey = %22xxxx%22;%0A    //api secret%0A    String aSecret = %22xxxx%22;%0A    //access token%0A    String aToken = %22xxx-xxxx%22;%0A    //access token secret%0A    String aTokenSecret = %22xxxx%22;%0A    %0A    //inisialisasi%0A    TwitterFactory twitFactory = new TwitterFactory();%0A    Twitter twit = twitFactory.getSingleton();%0A    %0A    //setup oauth%0A    twit.setOAuthConsumer(aKey,aSecret);%0A    twit.setOAuthAccessToken(new AccessToken(aToken,aTokenSecret));%0A    %0A    //---------------------//%0A    %0A    int menu;%0A    int choice;%0A    choice = 0;%0A    %0A    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));%0A    Scanner input = new Scanner(System.in);%0A    %0A    //menu%0A    System.out.println(%22 1. Update Status%22);%0A    System.out.println(%22 2. Send DM%22);%0A    System.out.println(%22 3. Exit%22);%0A    System.out.print(%22 Enter your choice: %22);%0A    menu = input.nextInt();%0A    %0A    while(menu != 3)%7B%0A      switch(menu)%7B%0A        case 1:%0A          try%7B%0A            System.out.println(%22%22);%0A            System.out.print(%22 Update status: %22);%0A            String stat = br.readLine();%0A            try%7B              %0A               Status status = twit.updateStatus(stat + %22 %5Bvia @nordskriving's app%5D%22);%0A             %7Dcatch(TwitterException e)%7B%0A               System.out.println(e);%0A             %7D%0A          %7Dcatch(IOException e)%7B%0A            System.out.println(e);%0A          %7D%0A          break;%0A        //menu 2%0A        case 2:%0A          try%7B%0A            System.out.println(%22%22);%0A            System.out.print(%22 To: %22);%0A            String forwho = br.readLine();%0A            System.out.print(%22 Msg: %22);%0A            String msg = br.readLine();%0A            try%7B%0A              DirectMessage dm = twit.sendDirectMessage(forwho,msg + %22%5Bvia @nordskriving's app%5D%22);%0A            %7Dcatch(TwitterException e)%7B%0A              System.out.println(e);%0A            %7D%0A          %7Dcatch(IOException e)%7B%0A            System.out.println(e);%0A          %7D%0A      %7D%0A      System.out.println(%22%22);%0A      System.out.println(%22 1. Update Status%22);%0A      System.out.println(%22 2. Send DM%22);%0A      System.out.println(%22 3. Exit%22);%0A      System.out.print(%22 Enter your choice: %22);%0A      menu = input.nextInt();%0A    %7D%0A    //exit%0A    System.out.println(%22%22);%0A    System.out.println(%22nordskriving.wordpress.com%22);%0A  %7D%0A%7D%0A          %0A

Create nrdtweeting.java