@@ -0,0 +1,1906 @@
+import twitter4j.Status;%0Aimport twitter4j.Twitter;%0Aimport twitter4j.TwitterException;%0Aimport twitter4j.TwitterFactory;%0Aimport twitter4j.conf.ConfigurationBuilder;%0A%0Aimport java.util.*;%0A%0Aimport javax.mail.MessagingException;%0Aimport javax.mail.internet.AddressException;%0A%0Apublic class TwitterMonitor %7B%0A%09%0A%09private static long lastID = 0;%0A%09%0A%09public static void main (String%5B%5D args) %7B%0A%09%09while(true) %7B%0A%09%09%09// The factory instance is re-useable and thread safe.%0A%09%09%09ConfigurationBuilder cb = new ConfigurationBuilder();%0A%09    %09cb.setDebugEnabled(true)%0A%09    %09  .setOAuthConsumerKey(%22************************%22)%0A%09    %09  .setOAuthConsumerSecret(%22************************%22)%0A%09    %09  .setOAuthAccessToken(%22************************%22)%0A%09    %09  .setOAuthAccessTokenSecret(%22************************%22);%0A%09%09    Twitter twitter = new TwitterFactory(cb.build()).getInstance();%0A%09%09    List%3CStatus%3E statuses = null;%0A%09%09%09try %7B%0A%09%09%09%09statuses = twitter.getUserTimeline();%0A%09%09%09%7D catch (TwitterException e) %7B%0A%09%09%09%09// TODO Auto-generated catch block%0A%09%09%09%09e.printStackTrace();%0A%09%09%09%09System.exit(1);%0A%09%09%09%7D%09%09%09%0A%09%09%09%0A%09%09    System.out.println(%22Showing user timeline.%22);%0A%09%09    for (Status status : statuses) %7B%0A%09%09    %09if(status.getId() %3E TwitterMonitor.lastID) %7B%0A%09%09%09    %09System.out.println(status.getId());%0A%09%09%09    %09TwitterMonitor.lastID = status.getId();%0A%09%09%09        System.out.println(status.getText());%0A%09%09%09%09%09try %7B%0A%09%09%09%09%09%09GoogleMail.Send(%22***********%22, %22***********%22, %22trigger@recipe.ifttt.com%22, status.getText(), %22%22);%0A%09%09%09%09%09%7D catch (AddressException e) %7B%0A%09%09%09%09%09%09// TODO Auto-generated catch block%0A%09%09%09%09%09%09e.printStackTrace();%0A%09%09%09%09%09%7D catch (MessagingException e) %7B%0A%09%09%09%09%09%09// TODO Auto-generated catch block%0A%09%09%09%09%09%09e.printStackTrace();%0A%09%09%09%09%09%7D%0A%09%09    %09%7D%0A%09%09    %7D%0A%09%09    System.out.println(%22------------------------%22);%0A%09%09    try %7B%0A%09%09%09%09Thread.sleep(5000);%0A%09%09%09%7D catch (InterruptedException e) %7B%0A%09%09%09%09// TODO Auto-generated catch block%0A%09%09%09%09e.printStackTrace();%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%09%0A%7D%0A

Create TwitterMonitor.java