ig-0.3.1: Bindings to Instagram's API.

Safe HaskellNone
LanguageHaskell98

Instagram

Description

the public API for Instagram access

Synopsis

Documentation

data InstagramT m a Source

the instagram monad transformer this encapsulates the data necessary to pass the app credentials, etc

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

Instances

Show IGException 
Exception IGException

make our exception type a normal exception

Typeable * IGException 

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 Credentials Source

the app credentials

Constructors

Credentials 

Fields

cClientID :: Text

client id

cClientSecret :: Text

client secret

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 
Ord OAuthToken 
Read OAuthToken 
Show OAuthToken 
ToJSON OAuthToken

to json as per Instagram format

FromJSON OAuthToken

from json as per Instagram format

Typeable * OAuthToken 

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 
Ord User 
Read User 
Show User 
ToJSON User

to json as per Instagram format

FromJSON User

from json as per Instagram format

Typeable * User 

data UserCounts Source

the User counts info returned by some endpoints

Constructors

UserCounts 

Instances

Eq UserCounts 
Ord UserCounts 
Read UserCounts 
Show UserCounts 
ToJSON UserCounts

to json as per Instagram format

FromJSON UserCounts

from json as per Instagram format

Typeable * UserCounts 

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) 
Ord d => Ord (Envelope d) 
Read d => Read (Envelope d) 
Show d => Show (Envelope d) 
ToJSON d => ToJSON (Envelope d)

to json as per Instagram format

FromJSON d => FromJSON (Envelope d)

from json as per Instagram format

Typeable (* -> *) Envelope 

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 
Ord Pagination 
Read Pagination 
Show Pagination 
ToJSON Pagination

to json as per Instagram format

FromJSON Pagination

from json as per Instagram format

Typeable * Pagination 

data Position Source

position in picture

Constructors

Position 

Fields

pX :: Double
 
pY :: Double
 

Instances

Eq Position 
Show Position 
ToJSON Position

to json as per Instagram format

FromJSON Position

from json as per Instagram format

Typeable * Position 

data UserPosition Source

position of a user

Constructors

UserPosition 

Instances

Eq UserPosition 
Show UserPosition 
ToJSON UserPosition

to json as per Instagram format

FromJSON UserPosition

from json as per Instagram format

Typeable * UserPosition 

data Location Source

geographical location info

Instances

Eq Location 
Ord Location 
Show Location 
ToJSON Location

to json as per Instagram format

FromJSON Location

from json as per Instagram format

Typeable * Location 

data ImageData Source

data for a single image

Constructors

ImageData 

Instances

Eq ImageData 
Ord ImageData 
Show ImageData 
ToJSON ImageData

to json as per Instagram format

FromJSON ImageData

from json as per Instagram format

Typeable * ImageData 

data Images Source

different images for the same media

Instances

Eq Images 
Ord Images 
Show Images 
ToJSON Images

to json as per Instagram format

FromJSON Images

from json as per Instagram format

Typeable * Images 

data Comment Source

Commenton on a medium

Constructors

Comment 

Instances

Eq Comment 
Ord Comment 
Show Comment 
ToJSON Comment

to json asCommentstagram format

FromJSON Comment

from json asCommentstagram format

Typeable * Comment 

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) 
Ord a => Ord (Collection a) 
Show a => Show (Collection a) 
ToJSON a => ToJSON (Collection a)

to json as per Instagram format

FromJSON a => FromJSON (Collection a)

from json as per Instagram format

Typeable (* -> *) Collection 

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 
Ord NoResult 
Read NoResult 
Show NoResult 
ToJSON NoResult

to json as per Instagram format

FromJSON NoResult

from json as per Instagram format

Typeable * NoResult 

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 -> 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 Aspect Source

notification aspect

Instances

Eq Aspect 
Ord Aspect 
Read Aspect 
Show Aspect 
ToJSON Aspect

to json as per Instagram format

FromJSON Aspect

from json as per Instagram format

Typeable * Aspect 

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 
Show Subscription 
ToJSON Subscription

to json as per Instagram format

FromJSON Subscription

from json as per Instagram format

Typeable * Subscription 

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 
Show Update 
ToJSON Update

to json as per Instagram format

FromJSON Update

from json as per Instagram format

Typeable * Update 

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 
Ord Tag 
Read Tag 
Show Tag 
ToJSON Tag

to json as per Instagram format

FromJSON Tag

from json as per Instagram format

Typeable * Tag 

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 OutgoingStatus Source

outgoing relationship status

Constructors

Follows 
Requested 
OutNone 

data IncomingStatus Source

incoming relationship status

data Relationship Source

a relationship between two users

Constructors

Relationship 

Instances

Eq Relationship 
Ord Relationship 
Read Relationship 
Show Relationship 
ToJSON Relationship

to json as per Instagram format

FromJSON Relationship

from json as per Instagram format

Typeable * Relationship 

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 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 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