Package com.sola.instagram.io

Examples of com.sola.instagram.io.GetMethod


    UriConstructor uriConstructor = new UriConstructor(getAccessToken());
    HashMap<String, Object> map = new HashMap<String, Object>();
    map.put("user_id", getId());
    String uri = uriConstructor.constructUri(
              UriFactory.Users.GET_DATA, map, true);
    JSONObject userObject = (new GetMethod()
                .setMethodURI(uri)
                ).call().getJSON();
   
    if(userObject.has("data")) {
      JSONObject counts = userObject.getJSONObject("data")
View Full Code Here


  public List<Comment> getComments() throws Exception {
    if(comments == null) {
      HashMap<String, Object> map = new HashMap<String, Object>();
      map.put("media_id", getId());
      String uri = uriConstructor.constructUri(UriFactory.Comments.GET_MEDIA_COMMENTS, map, true);
      JSONObject object = (new GetMethod(uri)).call().getJSON();
      JSONArray commentObjects    = object.getJSONArray("data");
      ArrayList<Comment> comments = new ArrayList<Comment>();
      for(int i = 0; i < commentObjects.length(); i++) {
        comments.add(new Comment(commentObjects.getJSONObject(i), accessToken));
      }
View Full Code Here

    if(likers == null) {
      try {
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put("media_id", getId());
        String uri = uriConstructor.constructUri(UriFactory.Likes.GET_LIKERS, map, true);
        JSONObject object      = (new GetMethod(uri)).call().getJSON();
        ArrayList<User> likers =  new ArrayList<User>();
        JSONArray likerUserObjects = object.getJSONArray("data");
        for(int i = 0; i < likerUserObjects.length(); i++) {
          likers.add(new User(likerUserObjects.getJSONObject(i), accessToken));
        }
View Full Code Here

    // not implenting this 
  }

  public void fetch() throws Exception {
    if(paginationComplete()) return;
    JSONObject object = (new GetMethod().setMethodURI(nextUri))
        .call().getJSON();
    JSONObject pagination = object.optJSONObject("pagination");
    nextUri = pagination == null ? null : pagination.optString("next_url");
    JSONArray data = object.optJSONArray("data");
    if(data != null) {
View Full Code Here

TOP

Related Classes of com.sola.instagram.io.GetMethod

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.