public class InstagramSession extends Object
Constructor and Description |
---|
InstagramSession() |
InstagramSession(AccessToken accessToken)
Creates a new Instagram session
|
Modifier and Type | Method and Description |
---|---|
protected String |
getAccessToken() |
PaginatedCollection<Media> |
getFeed()
Gets the recent media in the current user's feed
|
PaginatedCollection<User> |
getFollowers(int userId) |
List<User> |
getFollowRequests() |
PaginatedCollection<User> |
getFollows(int userId)
Gets a list of users that the user, whose id is passed, follows.
|
PaginatedCollection<Media> |
getLikedMedia()
Gets the recent media that the current user has liked.
|
Location |
getLocation(int locationId) |
Media |
getMedia(String mediaId)
Gets the media with the id passed.
|
List<Media> |
getPopularMedia()
Finds and returns the most popular media on instagram.
|
PaginatedCollection<Media> |
getRecentMediaForTag(String tagName) |
PaginatedCollection<Media> |
getRecentMediaFromLocation(int locationId) |
PaginatedCollection<Media> |
getRecentPublishedMedia(int userId)
Finds and returns the most recent media published by the user with the id
passed.
|
Relationship |
getRelationshipWith(int userId) |
Tag |
getTag(String tagName) |
User |
getUserById(int userId)
Finds and returns a user with the given id.
|
boolean |
likeMedia(String mediaId) |
boolean |
modifyRelationship(int userId,
Relationship.Action action) |
Comment |
postComment(String mediaId,
String text) |
boolean |
removeComment(String mediaId,
String commentId) |
void |
removeHttpProxy() |
boolean |
removeMediaLike(String mediaId) |
List<Media> |
searchMedia(Object latitude,
Object longitude,
Object minTimestamp,
Object maxTimestamp,
Object distance)
Searches for media by location and creation time.
|
List<Tag> |
searchTags(String tagName) |
List<User> |
searchUsersByName(String name)
Searches for users by name.
|
protected void |
setAccessToken(String accessToken) |
void |
setHttpProxy(String proxyAddress,
int proxyPort) |
public InstagramSession()
public InstagramSession(AccessToken accessToken)
accessToken
- the session's access tokenpublic void setHttpProxy(String proxyAddress, int proxyPort)
public void removeHttpProxy()
protected String getAccessToken()
protected void setAccessToken(String accessToken)
public User getUserById(int userId) throws Exception
userId
- id of the userException
public PaginatedCollection<Media> getRecentPublishedMedia(int userId) throws Exception
userId
- id of the userException,
- JSONExceptionException
public PaginatedCollection<Media> getFeed() throws Exception
Exception,
- JSONExceptionException
public PaginatedCollection<Media> getLikedMedia() throws Exception
Exception,
- JSONExceptionException
public Media getMedia(String mediaId) throws Exception
mediaId
- the id of the media to be returnedException,
- JSONExceptionException
public List<Media> searchMedia(Object latitude, Object longitude, Object minTimestamp, Object maxTimestamp, Object distance) throws Exception
latitude
- latitude of locationlongitude
- longitude of locationminTimestamp
- the min timestamp of media to be returned. Can be null if
needed.maxTimestamp
- the max timestamp of media to be returned. Can be null if
needed.distance
- the of the location. Can be null if needed.Exception,
- JSONExceptionException
public List<Media> getPopularMedia() throws Exception
Exception,
- JSONExceptionException
public List<User> searchUsersByName(String name) throws Exception
name
- the full name or username of the user to be returnedException,
- JSONExceptionException
public PaginatedCollection<User> getFollows(int userId) throws Exception
userId
- id of the user whose follow list is to be returnedException,
- JSONExceptionException
public PaginatedCollection<User> getFollowers(int userId) throws Exception
Exception
public Relationship getRelationshipWith(int userId) throws Exception
Exception
public boolean modifyRelationship(int userId, Relationship.Action action) throws Exception
Exception
public Comment postComment(String mediaId, String text) throws Exception
Exception
public boolean removeComment(String mediaId, String commentId) throws Exception
Exception
public boolean likeMedia(String mediaId) throws Exception, JSONException
Exception
JSONException
public PaginatedCollection<Media> getRecentMediaForTag(String tagName) throws Exception
Exception
public PaginatedCollection<Media> getRecentMediaFromLocation(int locationId) throws Exception
Exception
Copyright © 2013. All Rights Reserved.