|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sola.instagram.InstagramSession
public class InstagramSession
Constains a methods used to interact with the API.
Constructor Summary | |
---|---|
InstagramSession()
|
|
InstagramSession(AccessToken accessToken)
Creates a new Instagram session |
Method Summary | |
---|---|
PaginatedCollection<Media> |
getFeed()
Gets the recent media in the current user's feed |
PaginatedCollection<User> |
getFollowers(int userId)
|
java.util.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(java.lang.String mediaId)
Gets the media with the id passed. |
java.util.List<Media> |
getPopularMedia()
Finds and returns the most popular media on instagram. |
PaginatedCollection<Media> |
getRecentMediaForTag(java.lang.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(java.lang.String tagName)
|
User |
getUserById(int userId)
Finds and returns a user with the given id. |
boolean |
likeMedia(java.lang.String mediaId)
|
DeleteMethod |
makeDeleteMethod()
|
GetMethod |
makeGetMethod()
|
PostMethod |
makePostMethod()
|
boolean |
modifyRelationship(int userId,
Relationship.Action action)
|
Comment |
postComment(java.lang.String mediaId,
java.lang.String text)
|
boolean |
removeComment(java.lang.String mediaId,
java.lang.String commentId)
|
void |
removeHttpProxy()
Removes the HTTP proxy config |
boolean |
removeMediaLike(java.lang.String mediaId)
|
java.util.List<Media> |
searchMedia(java.lang.Object latitude,
java.lang.Object longitude,
java.lang.Object minTimestamp,
java.lang.Object maxTimestamp,
java.lang.Object distance)
Searches for media by location and creation time. |
java.util.List<Tag> |
searchTags(java.lang.String tagName)
|
java.util.List<User> |
searchUsersByName(java.lang.String name)
Searches for users by name. |
void |
setHttpProxy(java.lang.String address,
int port)
Sets an HTTP proxy for api requests |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InstagramSession()
public InstagramSession(AccessToken accessToken)
accessToken
- the session's access tokenMethod Detail |
---|
public void setHttpProxy(java.lang.String address, int port)
address
- ip address of the proxyport
- port number of the proxypublic void removeHttpProxy()
public GetMethod makeGetMethod()
public PostMethod makePostMethod()
public DeleteMethod makeDeleteMethod()
public User getUserById(int userId) throws java.lang.Exception
userId
- id of the user
java.lang.Exception
public PaginatedCollection<Media> getRecentPublishedMedia(int userId) throws java.lang.Exception
userId
- id of the user
Exception,
- JSONException
java.lang.Exception
public PaginatedCollection<Media> getFeed() throws java.lang.Exception
Exception,
- JSONException
java.lang.Exception
public PaginatedCollection<Media> getLikedMedia() throws java.lang.Exception
Exception,
- JSONException
java.lang.Exception
public Media getMedia(java.lang.String mediaId) throws java.lang.Exception
mediaId
- the id of the media to be returned
Exception,
- JSONException
java.lang.Exception
public java.util.List<Media> searchMedia(java.lang.Object latitude, java.lang.Object longitude, java.lang.Object minTimestamp, java.lang.Object maxTimestamp, java.lang.Object distance) throws java.lang.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,
- JSONException
java.lang.Exception
public java.util.List<Media> getPopularMedia() throws java.lang.Exception
Exception,
- JSONException
java.lang.Exception
public java.util.List<User> searchUsersByName(java.lang.String name) throws java.lang.Exception
name
- the full name or username of the user to be returned
Exception,
- JSONException
java.lang.Exception
public PaginatedCollection<User> getFollows(int userId) throws java.lang.Exception
userId
- id of the user whose follow list is to be returned
Exception,
- JSONException
java.lang.Exception
public PaginatedCollection<User> getFollowers(int userId) throws java.lang.Exception
java.lang.Exception
public java.util.List<User> getFollowRequests() throws java.lang.Exception, JSONException, JSONException
java.lang.Exception
JSONException
public Relationship getRelationshipWith(int userId) throws java.lang.Exception
java.lang.Exception
public boolean modifyRelationship(int userId, Relationship.Action action) throws java.lang.Exception
java.lang.Exception
public Comment postComment(java.lang.String mediaId, java.lang.String text) throws java.lang.Exception
java.lang.Exception
public boolean removeComment(java.lang.String mediaId, java.lang.String commentId) throws java.lang.Exception
java.lang.Exception
public boolean likeMedia(java.lang.String mediaId) throws java.lang.Exception, JSONException
java.lang.Exception
JSONException
public boolean removeMediaLike(java.lang.String mediaId) throws java.lang.Exception
java.lang.Exception
public Tag getTag(java.lang.String tagName) throws java.lang.Exception
java.lang.Exception
public PaginatedCollection<Media> getRecentMediaForTag(java.lang.String tagName) throws java.lang.Exception
java.lang.Exception
public java.util.List<Tag> searchTags(java.lang.String tagName) throws java.lang.Exception
java.lang.Exception
public Location getLocation(int locationId) throws java.lang.Exception
java.lang.Exception
public PaginatedCollection<Media> getRecentMediaFromLocation(int locationId) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |