Package weibo4j

Examples of weibo4j.Timeline


public class GetUserTimelineIds {
  public static void main(String[] args) {
//    String access_token = args[0];
    String access_token = "2.009q4JaB0boMkW8e5efb98210m4BKY";
    Timeline tm = new Timeline();
//    tm.client.setToken(access_token);
    tm.setToken(access_token);
    try {
//      JSONObject ids = tm.getUserTimelineIdsByUid(args[1]);
      JSONObject ids = tm.getUserTimelineIdsByUid("1450317544");
      Log.logInfo(ids.toString());
      JSONArray array = (JSONArray) ids.get("statuses");

      ArrayList<String> list = new ArrayList<String>();
      for (int i = 0; i < array.length(); ++i) {
        list.add(array.get(i).toString());
      }

      System.out.println(list.size());

      StatusWapper wrapper = tm.getUserTimelineByUid("1450317544", new Paging(1), 0, 0);
      System.out.println(wrapper.getStatuses().size());

      wrapper = tm.getUserTimelineByUid("1450317544", new Paging(2), 0, 0);
      System.out.println(wrapper.getStatuses().size());
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here


public class GetFriendsTimelineIds {

  public static void main(String[] args) {
    String access_token = args[0];
    Timeline tm = new Timeline();
    tm.setToken(access_token);
    tm.client.setToken(access_token);
    try {
      JSONObject status = tm.getFriendsTimelineIds();
      Log.logInfo(status.toString());
    } catch (WeiboException e) {
      e.printStackTrace();
    }
View Full Code Here

public class GetUserTimeline {

  public static void main(String[] args) {
//    String access_token = args[0];
    String access_token = "2.009q4JaB0boMkW8e5efb98210m4BKY";
    Timeline tm = new Timeline();
    tm.client.setToken(access_token);
    try {
      StatusWapper status = tm.getUserTimeline();
      for (Status s : status.getStatuses()) {
        Log.logInfo(s.toString());
      }
      System.out.println(status.getNextCursor());
      System.out.println(status.getPreviousCursor());
View Full Code Here

public class UpdateStatus {

  public static void main(String[] args) {
    String access_token = args[0];
    String statuses = args[1];
    Timeline tm = new Timeline();
    tm.client.setToken(access_token);
    try {
      Status status = tm.UpdateStatus(statuses);
      Log.logInfo(status.toString());
    } catch (WeiboException e) {
      e.printStackTrace();
    }  }
View Full Code Here

public class GetHomeTimeline {

  public static void main(String[] args) {
    String access_token = args[0];
    Timeline tm = new Timeline();
    tm.client.setToken(access_token);
    try {
      StatusWapper status = tm.getHomeTimeline();
      for(Status s : status.getStatuses()){
        Log.logInfo(s.toString());
      }
      System.out.println(status.getNextCursor());
      System.out.println(status.getPreviousCursor());
View Full Code Here

  }

  public static void main(String[] args) {
//    String access_token = args[0];
    String access_token = "2.009q4JaB0boMkW8e5efb98210m4BKY";
    Timeline tm = new Timeline();
//    tm.client.setToken(access_token);
    tm.setToken(access_token);
    try {
//      JSONObject ids = tm.getUserTimelineIdsByUid(args[1]);
      JSONObject ids = tm.getUserTimelineIdsByUid("1450317544");
      Log.logInfo(ids.toString());
      JSONArray array = (JSONArray) ids.get("statuses");

      ArrayList<String> list = new ArrayList<String>();
      for (int i = 0; i < array.length(); ++i) {
        list.add(array.get(i).toString());
      }

      System.out.println(list.size());

      StatusWapper wrapper = tm.getUserTimelineByUid("1450317544", new Paging(1), 0, 0);
      System.out.println(wrapper.getStatuses().size());

      wrapper = tm.getUserTimelineByUid("1450317544", new Paging(2), 0, 0);
      System.out.println(wrapper.getStatuses().size());
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

TOP

Related Classes of weibo4j.Timeline

Copyright © 2018 www.massapicom. 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.