ig-0.6.1: Bindings to Instagram's API.

Safe HaskellNone
LanguageHaskell98

Instagram

Description

the public API for Instagram access

Synopsis

Documentation

runInstagramT Source

Arguments

:: Credentials

Your app's credentials.

-> Manager

Connection manager (see withManager).

-> InstagramT m a

the action to run

-> m a

the result

Run a computation in the InstagramT monad transformer with your credentials.

data IGException Source

an exception that a call to instagram may throw

Constructors

JSONException String

JSON parsingError

IGAppException IGError

application exception

Instances

Show IGException Source 
Exception IGException Source

make our exception type a normal exception

data IGError Source

an error returned to us by Instagram

Constructors

IGError 

Instances

Eq IGError Source 
Ord IGError Source 
Read IGError Source 
Show IGError Source 
ToJSON IGError Source

to json as per Instagram format

FromJSON IGError Source

from json as per Instagram format

type RedirectUri = Text Source

the URI to redirect the user after she accepts/refuses to authorize the app

getUserAccessTokenURL1 Source

Arguments

:: Monad m 
=> RedirectUri

the URI to redirect the user after she accepts/refuses to authorize the app

-> [Scope]

the requested scopes (can be empty for Basic)

-> InstagramT m Text

the URL to redirect the user to

get the authorize url to redirect your user to

getUserAccessTokenURL2 Source

Arguments

:: (MonadBaseControl IO m, MonadResource m) 
=> RedirectUri

the redirect uri

-> Text

the code sent back to your app

-> InstagramT m OAuthToken

the auth token

second step of authorization: get the access token once the user has been redirected with a code

data OAuthToken Source

the oauth token returned after authentication

Constructors

OAuthToken 

Fields

oaAccessToken :: AccessToken

the access token

oaUser :: User

the user structure returned

Instances

Eq OAuthToken Source 
Ord OAuthToken Source 
Read OAuthToken Source 
Show OAuthToken Source 
ToJSON OAuthToken Source

to json as per Instagram format

FromJSON OAuthToken Source

from json as per Instagram format

newtype AccessToken Source

the access token is simply a Text

Constructors

AccessToken Text 

data User Source

the User partial profile returned by the authentication

Instances

Eq User Source 
Ord User Source 
Read User Source 
Show User Source 
ToJSON User Source

to json as per Instagram format

FromJSON User Source

from json as per Instagram format

data UserCounts Source

the User counts info returned by some endpoints

Constructors

UserCounts 

Instances

Eq UserCounts Source 
Ord UserCounts Source 
Read UserCounts Source 
Show UserCounts Source 
ToJSON UserCounts Source

to json as per Instagram format

FromJSON UserCounts Source

from json as per Instagram format

data Scope Source

the scopes of the authentication

data Envelope d Source

envelope for Instagram OK response

Constructors

Envelope 

Fields

eMeta :: IGError

this should only say 200, no error, but put here for completeness

eData :: d

data, garanteed to be present (otherwise we get an ErrEnvelope)

ePagination :: Maybe Pagination
 

Instances

Eq d => Eq (Envelope d) Source 
Ord d => Ord (Envelope d) Source 
Read d => Read (Envelope d) Source 
Show d => Show (Envelope d) Source 
ToJSON d => ToJSON (Envelope d) Source

to json as per Instagram format

FromJSON d => FromJSON (Envelope d) Source

from json as per Instagram format

getNextPage :: (MonadBaseControl IO m, MonadResource m, FromJSON v) => Envelope v -> InstagramT m (Maybe (Envelope v)) Source

Use the pagination links in an Envelope to fetch the next page of results.

If the Envelope has no pagination, or we have reached the final page (indicated by the pNextUrl field being missing), returns Nothing.

data Pagination Source

pagination info for responses that can return a lot of data

Instances

Eq Pagination Source 
Ord Pagination Source 
Read Pagination Source 
Show Pagination Source 
ToJSON Pagination Source

to json as per Instagram format

FromJSON Pagination Source

from json as per Instagram format

data Position Source

position in picture

Constructors

Position 

Fields

pX :: Double
 
pY :: Double
 

Instances

Eq Position Source 
Show Position Source 
ToJSON Position Source

to json as per Instagram format

FromJSON Position Source

from json as per Instagram format

data UserPosition Source

position of a user

Constructors

UserPosition 

Instances

Eq UserPosition Source 
Show UserPosition Source 
ToJSON UserPosition Source

to json as per Instagram format

FromJSON UserPosition Source

from json as per Instagram format

data Location Source

geographical location info

Instances

Eq Location Source 
Ord Location Source 
Show Location Source 
ToJSON Location Source

to json as per Instagram format

FromJSON Location Source

from json as per Instagram format

data ImageData Source

data for a single image

Constructors

ImageData 

Instances

Eq ImageData Source 
Ord ImageData Source 
Show ImageData Source 
ToJSON ImageData Source

to json as per Instagram format

FromJSON ImageData Source

from json as per Instagram format

data Images Source

different images for the same media

Instances

Eq Images Source 
Ord Images Source 
Show Images Source 
ToJSON Images Source

to json as per Instagram format

FromJSON Images Source

from json as per Instagram format

data Comment Source

Commenton on a medium

Constructors

Comment 

Instances

Eq Comment Source 
Ord Comment Source 
Show Comment Source 
ToJSON Comment Source

to json asCommentstagram format

FromJSON Comment Source

from json asCommentstagram format

data Collection a Source

a collection of items (count + data) data can only be a subset

Constructors

Collection 

Fields

cCount :: Integer
 
cData :: [a]
 

Instances

Eq a => Eq (Collection a) Source 
Ord a => Ord (Collection a) Source 
Show a => Show (Collection a) Source 
ToJSON a => ToJSON (Collection a) Source

to json as per Instagram format

FromJSON a => FromJSON (Collection a) Source

from json as per Instagram format

data NoResult Source

Instagram returns data:null for nothing, but Aeson considers that () maps to an empty array... so we model the fact that we expect null via NoResult

Instances

Eq NoResult Source 
Ord NoResult Source 
Read NoResult Source 
Show NoResult Source 
ToJSON NoResult Source

to json as per Instagram format

FromJSON NoResult Source

from json as per Instagram format

type UserID = Text Source

User ID

getUser :: (MonadBaseControl IO m, MonadResource m) => UserID -> Maybe OAuthToken -> InstagramT m (Envelope (Maybe User)) Source

Get basic information about a user.

getSelfFeed :: (MonadBaseControl IO m, MonadResource m) => OAuthToken -> SelfFeedParams -> InstagramT m (Envelope [Media]) Source

See the authenticated user's feed.

getRecent :: (MonadBaseControl IO m, MonadResource m) => UserID -> Maybe OAuthToken -> RecentParams -> InstagramT m (Envelope [Media]) Source

Get the most recent media published by a user.

getSelfLiked :: (MonadBaseControl IO m, MonadResource m) => OAuthToken -> SelfLikedParams -> InstagramT m (Envelope [Media]) Source

See the authenticated user's list of media they've liked.

data UserSearchParams Source

parameters for self liked call

Constructors

UserSearchParams 

data Aspect Source

notification aspect

Instances

Eq Aspect Source 
Ord Aspect Source 
Read Aspect Source 
Show Aspect Source 
ToJSON Aspect Source

to json as per Instagram format

FromJSON Aspect Source

from json as per Instagram format

media :: Aspect Source

the media Aspect, the only one supported for now

type CallbackUrl = Text Source

the URL to receive notifications to

data Subscription Source

a subscription to a real time notification

Instances

Eq Subscription Source 
Show Subscription Source 
ToJSON Subscription Source

to json as per Instagram format

FromJSON Subscription Source

from json as per Instagram format

createSubscription Source

Arguments

:: (MonadBaseControl IO m, MonadResource m) 
=> SubscriptionParams

the subscription parameters

-> InstagramT m (Envelope Subscription)

the created subscription

create a subscription

listSubscriptions Source

Arguments

:: (MonadBaseControl IO m, MonadResource m) 
=> InstagramT m (Envelope [Subscription])

the ID of the subscription

list all subscriptions for the application

deleteSubscriptions Source

Arguments

:: (MonadBaseControl IO m, MonadResource m) 
=> DeletionParams

the parameters for the deletion

-> InstagramT m (Envelope Value)

the ID of the subscription

delete subscriptions based on criteria

data SubscriptionRequest Source

details of subscription request

Constructors

UserRequest

when a user uploads a picture

TagRequest

when a picture is tagged with the given tag

Fields

trTag :: Text
 
LocationRequest

when a picture is tagged with a specific location

Fields

lrID :: Text
 
GeographyRequest

when a picture is tagged with a location inside the given region

data SubscriptionParams Source

parameters for the subscription creation

Constructors

SubscriptionParams 

Fields

spRequest :: SubscriptionRequest

the actual subscription request

spCallback :: CallbackUrl

the url Instagram will post notifications to

spAspect :: Aspect

the subscription aspect

spVerifyToken :: Maybe Text

the verification token

data DeletionParams Source

deletion parameters

Constructors

DeleteAll

delete all subscriptions

DeleteOne

delete one subscription, given its ID

Fields

doID :: Text
 
DeleteUsers

delete all user subscriptions

DeleteTags

delete all tag subscriptions

DeleteLocations

delete all location subscriptions

DeleteGeographies

delete all geography subscriptions

data Update Source

an update from a subscription

Instances

Eq Update Source 
Show Update Source 
ToJSON Update Source

to json as per Instagram format

FromJSON Update Source

from json as per Instagram format

verifySignature Source

Arguments

:: Monad m 
=> ByteString

the signature

-> ByteString

the content

-> InstagramT m Bool 

verify the signature with the content, using the secret as the key

data Tag Source

a Tag

Constructors

Tag 

Instances

Eq Tag Source 
Ord Tag Source 
Read Tag Source 
Show Tag Source 
ToJSON Tag Source

to json as per Instagram format

FromJSON Tag Source

from json as per Instagram format

type TagName = Text Source

Tag Name

getTag :: (MonadBaseControl IO m, MonadResource m) => TagName -> Maybe OAuthToken -> InstagramT m (Envelope (Maybe Tag)) Source

Get information about a tag object.

getRecentTagged :: (MonadBaseControl IO m, MonadResource m) => TagName -> Maybe OAuthToken -> RecentTagParams -> InstagramT m (Envelope [Media]) Source

Get a list of recently tagged media.

data Relationship Source

a relationship between two users

Constructors

Relationship 

Instances

getFollows :: (MonadBaseControl IO m, MonadResource m) => UserID -> Maybe OAuthToken -> InstagramT m (Envelope [User]) Source

Get the list of users this user follows.

getFollowedBy :: (MonadBaseControl IO m, MonadResource m) => UserID -> Maybe Int -> Maybe OAuthToken -> InstagramT m (Envelope [User]) Source

Get the list of users this user is followed by.

getFollowsParams :: (MonadBaseControl IO m, MonadResource m) => UserID -> Maybe OAuthToken -> FollowParams -> InstagramT m (Envelope [User]) Source

Get the list of users this user follows.

getFollowedByParams :: (MonadBaseControl IO m, MonadResource m) => UserID -> Maybe OAuthToken -> FollowParams -> InstagramT m (Envelope [User]) Source

Get the list of users this user is followed by.

getRequestedBy :: (MonadBaseControl IO m, MonadResource m) => OAuthToken -> InstagramT m (Envelope [User]) Source

List the users who have requested this user's permission to follow.

getRelationship :: (MonadBaseControl IO m, MonadResource m) => UserID -> OAuthToken -> InstagramT m (Envelope Relationship) Source

Get information about a relationship to another user.

setRelationShip :: (MonadBaseControl IO m, MonadResource m) => UserID -> OAuthToken -> RelationShipAction -> InstagramT m (Envelope (Maybe Relationship)) Source

Modify the relationship between the current user and the target user.

type MediaID = Text Source

Media ID

getMedia :: (MonadBaseControl IO m, MonadResource m) => MediaID -> Maybe OAuthToken -> InstagramT m (Envelope (Maybe Media)) Source

Get information about a media object.

getPopularMedia :: (MonadBaseControl IO m, MonadResource m) => Maybe OAuthToken -> InstagramT m (Envelope [Media]) Source

Get a list of what media is most popular at the moment.

type CommentID = Text Source

comment id

getComments :: (MonadBaseControl IO m, MonadResource m) => MediaID -> Maybe OAuthToken -> InstagramT m (Envelope [Comment]) Source

Get a full list of comments on a media.

postComment :: (MonadBaseControl IO m, MonadResource m) => MediaID -> OAuthToken -> Text -> InstagramT m (Envelope NoResult) Source

Create a comment on a media.

deleteComment :: (MonadBaseControl IO m, MonadResource m) => MediaID -> CommentID -> OAuthToken -> InstagramT m (Envelope NoResult) Source

Remove a comment either on the authenticated user's media or authored by the authenticated user.

getLikes :: (MonadBaseControl IO m, MonadResource m) => MediaID -> Maybe OAuthToken -> InstagramT m (Envelope [User]) Source

Get a list of users who have liked this media.

like :: (MonadBaseControl IO m, MonadResource m) => MediaID -> OAuthToken -> InstagramT m (Envelope NoResult) Source

Set a like on this media by the currently authenticated user.

unlike :: (MonadBaseControl IO m, MonadResource m) => MediaID -> OAuthToken -> InstagramT m (Envelope NoResult) Source

Remove a like on this media by the currently authenticated user.

type LocationID = Text Source

location ID

getLocationRecentMedia :: (MonadBaseControl IO m, MonadResource m) => LocationID -> Maybe OAuthToken -> LocationMediaParams -> InstagramT m (Envelope [Media]) Source

Get a list of recent media objects from a given location.

searchLocations :: (MonadBaseControl IO m, MonadResource m) => Maybe OAuthToken -> LocationSearchParams -> InstagramT m (Envelope [Location]) Source

Search for a location by geographic coordinate.

type GeographyID = Text Source

geography ID

getGeographyRecentMedia :: (MonadBaseControl IO m, MonadResource m) => GeographyID -> GeographyMediaParams -> InstagramT m (Envelope [Media]) Source

Get very recent media from a geography subscription that you created