Package weibo4j.examples.timeline

Source Code of weibo4j.examples.timeline.GetPublicTimeline

package weibo4j.examples.timeline;

import weibo4j.Timeline;
import weibo4j.Weibo;
import weibo4j.examples.oauth2.Log;
import weibo4j.model.Status;
import weibo4j.model.StatusWapper;
import weibo4j.model.WeiboException;


public class GetPublicTimeline {

  public static void main(String[] args) {
    String access_token = args[0];
    Weibo weibo = new Weibo();
    weibo.setToken(access_token);
    Timeline tm = new Timeline();
    try {
      StatusWapper status = tm.getPublicTimeline();
      for(Status s : status.getStatuses()){
        Log.logInfo(s.toString());
      }
      System.out.println(status.getNextCursor());
      System.out.println(status.getPreviousCursor());
      System.out.println(status.getTotalNumber());
      System.out.println(status.getHasvisible());
    } catch (WeiboException e) {
      e.printStackTrace();
    }
  }

}
TOP

Related Classes of weibo4j.examples.timeline.GetPublicTimeline

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.