예제 #1
0
 /** @param args */
 public static void main(String[] args) {
   System.setProperty("weibo4j.oauth.consumerKey", Weibo.CONSUMER_KEY);
   System.setProperty("weibo4j.oauth.consumerSecret", Weibo.CONSUMER_SECRET);
   try {
     User user = getWeibo(true, args).verifyCredentials();
     System.out.println(user.toString());
   } catch (WeiboException e) {
     e.printStackTrace();
   }
 }
예제 #2
0
 /**
  * 获取当前用户的收藏列表
  *
  * @param args
  */
 public static void main(String[] args) {
   System.setProperty("weibo4j.oauth.consumerKey", Weibo.CONSUMER_KEY);
   System.setProperty("weibo4j.oauth.consumerSecret", Weibo.CONSUMER_SECRET);
   try {
     List<Status> list = getWeibo(false, args).getFavorites();
     for (Status status : list) {
       System.out.println(status.toString());
     }
   } catch (WeiboException e) {
     e.printStackTrace();
   }
 }
예제 #3
0
 /**
  * 删除一条私信
  *
  * @param args
  */
 public static void main(String[] args) {
   System.setProperty("weibo4j.oauth.consumerKey", Weibo.CONSUMER_KEY);
   System.setProperty("weibo4j.oauth.consumerSecret", Weibo.CONSUMER_SECRET);
   try {
     Weibo weibo = getWeibo(true, args);
     weibo.destroyDirectMessage(Integer.parseInt(args[2]));
     List<DirectMessage> list = weibo.getDirectMessages();
     for (DirectMessage msg : list) {
       System.out.println(msg.toString());
     }
   } catch (WeiboException e) {
     e.printStackTrace();
   }
 }