ig-0.1: Bindings to Instagram's API.

Safe HaskellNone

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

runInstagramTSource

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 
Typeable IGException 
Exception IGException

make our exception type a normal exception

type RedirectUri = TextSource

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

getUserAccessTokenURL1Source

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

getUserAccessTokenURL2Source

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 
Typeable OAuthToken 
ToJSON OAuthToken

to json as per Instagram format

FromJSON OAuthToken

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

to json as per Instagram format

FromJSON User

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

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

data Pagination Source

pagination info for responses that can return a lot of data

Instances

Eq Pagination 
Ord Pagination 
Read Pagination 
Show Pagination 
Typeable Pagination 
ToJSON Pagination

to json as per Instagram format

FromJSON Pagination

from json as per Instagram format

data Media Source

instagram media object

Constructors

Media 

Fields

mID :: MediaID
 
mCaption :: Maybe Comment
 
mLink :: Text
 
mUser :: User
 
mCreated :: POSIXTime
 
mImages :: Images
 
mType :: Text
 
mUsersInPhoto :: [UserPosition]
 
mFilter :: Maybe Text
 
mTags :: [Text]
 
mLocation :: Maybe Location
 
mComments :: Collection Comment
 
mLikes :: Collection User
 
mUserHasLiked :: Bool
 
mAttribution :: Maybe Object

seems to be open format https:groups.google.comforum?fromgroups#!topicinstagram-api-developersKvGH1cnjljQ

Instances

Eq Media 
Show Media 
Typeable Media 
ToJSON Media

to json as per Instagram format

FromJSON Media

from json as per Instagram format

data Position Source

position in picture

Constructors

Position 

Fields

pX :: Double
 
pY :: Double
 

Instances

Eq Position 
Show Position 
Typeable Position 
ToJSON Position

to json as per Instagram format

FromJSON Position

from json as per Instagram format

data UserPosition Source

position of a user

Constructors

UserPosition 

Instances

Eq UserPosition 
Show UserPosition 
Typeable UserPosition 
ToJSON UserPosition

to json as per Instagram format

FromJSON UserPosition

from json as per Instagram format

data Location Source

geographical location info

Instances

Eq Location 
Ord Location 
Show Location 
Typeable Location 
ToJSON Location

to json as per Instagram format

FromJSON Location

from json as per Instagram format

data ImageData Source

data for a single image

Constructors

ImageData 

Instances

Eq ImageData 
Ord ImageData 
Show ImageData 
Typeable ImageData 
ToJSON ImageData

to json as per Instagram format

FromJSON ImageData

from json as per Instagram format

data Images Source

different images for the same media

Instances

Eq Images 
Ord Images 
Show Images 
Typeable Images 
ToJSON Images

to json as per Instagram format

FromJSON Images

from json as per Instagram format

data Comment Source

Commenton on a medium

Constructors

Comment 

Instances

Eq Comment 
Ord Comment 
Show Comment 
Typeable Comment 
ToJSON Comment

to json asCommentstagram format

FromJSON Comment

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

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

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 
Typeable NoResult 
ToJSON NoResult

to json as per Instagram format

FromJSON NoResult

from json as per Instagram format

type UserID = TextSource

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 
Typeable Aspect 
ToJSON Aspect

to json as per Instagram format

FromJSON Aspect

from json as per Instagram format

media :: AspectSource

the media Aspect, the only one supported for now

type CallbackUrl = TextSource

the URL to receive notifications to

data Subscription Source

a subscription to a real time notification

Instances

Eq Subscription 
Show Subscription 
Typeable Subscription 
ToJSON Subscription

to json as per Instagram format

FromJSON Subscription

from json as per Instagram format

createSubscriptionSource

Arguments

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

the subscription parameters

-> InstagramT m (Envelope Subscription)

the created subscription

create a subscription

listSubscriptionsSource

Arguments

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

the ID of the subscription

list all subscriptions for the application

deleteSubscriptionsSource

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

to json as per Instagram format

FromJSON Update

from json as per Instagram format

verifySignatureSource

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 
Typeable Tag 
ToJSON Tag

to json as per Instagram format

FromJSON Tag

from json as per Instagram format

type TagName = TextSource

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

a relationship between two users

Constructors

Relationship 

Instances

Eq Relationship 
Ord Relationship 
Read Relationship 
Show Relationship 
Typeable Relationship 
ToJSON Relationship

to json as per Instagram format

FromJSON Relationship

from json as per Instagram format

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.

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

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

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

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

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