Esempio n. 1
0
  /**
   * Get basic information about a user.
   *
   * @return a UserInfo object.
   * @throws InstagramException if any error occurs.
   */
  public UserInfo getCurrentUserInfo() throws InstagramException {
    LogHelper.logEntrance(logger, "getCurrentUserInfo", null);

    logger.info("Getting current user info...");

    return createInstagramObject(Verbs.GET, UserInfo.class, Methods.USERS_SELF, null);
  }
Esempio n. 2
0
  /**
   * Get basic information about a user.
   *
   * @param userId user-id
   * @return a MediaFeed object.
   * @throws InstagramException if any error occurs.
   */
  public UserInfo getUserInfo(String userId) throws InstagramException {

    LogHelper.logEntrance(logger, "getUserInfo", userId);

    logger.info("Getting user info for : " + userId);

    Preconditions.checkEmptyString(userId, "UserId cannot be null or empty.");

    String apiMethod = String.format(Methods.USERS_WITH_ID, userId);

    return createInstagramObject(Verbs.GET, UserInfo.class, apiMethod, null);
  }
Esempio n. 3
0
  /**
   * See the authenticated user's feed
   *
   * @param maxId
   * @param minId
   * @param count Count of media to return.
   * @return a MediaFeed object.
   * @throws InstagramException if any error occurs.
   */
  public MediaFeed getUserFeeds(String maxId, String minId, long count) throws InstagramException {
    LogHelper.logEntrance(
        logger,
        "getUserFeeds",
        "[ maxId : " + maxId + ", minId : " + minId + ", count : " + count + "]");

    Map<String, String> params = new HashMap<String, String>();

    if (maxId != null) {
      params.put(QueryParam.MAX_ID, String.valueOf(maxId));
    }

    if (minId != null) {
      params.put(QueryParam.MIN_ID, String.valueOf(minId));
    }

    if (count != 0) {
      params.put(QueryParam.COUNT, String.valueOf(count));
    }

    return createInstagramObject(Verbs.GET, MediaFeed.class, Methods.USERS_SELF_FEED, params);
  }
Esempio n. 4
0
  /**
   * See the authenticated user's feed.
   *
   * @return a MediaFeed object.
   * @throws InstagramException if any error occurs.
   */
  public MediaFeed getUserFeeds() throws InstagramException {
    LogHelper.logEntrance(logger, "getUserFeeds", null);

    return createInstagramObject(Verbs.GET, MediaFeed.class, Methods.USERS_SELF_FEED, null);
  }