-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Haskell binding to the FriendFeed API
--
-- The hs-ffeed API binding lets you access friendfeed.com's resources
-- and methods from Haskell. Implements the full API, as specified at
-- http:code.google.compfriendfeed-apiwikiApiDocumentation
@package ffeed
@version 0.3.1
-- | License : See the file LICENSE
--
-- Status : Coded
--
-- Codec for de/encoding URI strings via percent encodings (cf. RFC
-- 3986.)
module Util.Codec.Percent
getEncodedString :: String -> String
getDecodedString :: String -> String
getEncodedChar :: Char -> Maybe String
getDecodedChar :: String -> Maybe (Char, String)
module Util.Codec.URLEncoder
encodeString :: String -> String
decodeString :: String -> String
-- | Simple GET/de-ref of URLs; abstracting out networking backend/package.
module Util.Fetch
readContentsURL :: URLString -> IO String
readUserContentsURL :: User -> URLString -> IO String
postContentsURL :: Maybe User -> URLString -> [(String, String)] -> String -> IO String
type URLString = String
data User
User :: String -> String -> User
userName :: User -> String
userPass :: User -> String
-- | Monadic layer for handling calls and processing of FriendFeed API
-- interaction.
module FriendFeed.Monad
newtype FFm a
FFm :: (FFmEnv -> IO a) -> FFm a
data FFmEnv
FFmEnv :: AuthUser -> Maybe Int -> Maybe Int -> [String] -> Bool -> URLString -> FFmEnv
ffm_auth_user :: FFmEnv -> AuthUser
ffm_page_size :: FFmEnv -> Maybe Int
ffm_entry_start :: FFmEnv -> Maybe Int
ffm_services_filter :: FFmEnv -> [String]
ffm_is_post :: FFmEnv -> Bool
ffm_base :: FFmEnv -> URLString
nullFFmEnv :: AuthUser -> FFmEnv
runFF :: String -> String -> FFm a -> IO a
withUser :: String -> String -> FFm a -> FFm a
forService :: String -> FFm a -> FFm a
startIndex :: Int -> FFm a -> FFm a
withPageSize :: Int -> FFm a -> FFm a
withBase :: URLString -> FFm a -> FFm a
withEnv :: (FFmEnv -> FFmEnv) -> FFm a -> FFm a
postMethod :: FFm a -> FFm a
authCall :: FFm a -> FFm a
data AuthUser
AuthUser :: String -> String -> AuthUser
authUserName :: AuthUser -> String
authUserKey :: AuthUser -> String
liftIO :: IO a -> FFm a
ffeedCall_ :: [String] -> [(String, String)] -> FFm ()
checkResponse :: String -> ErrM String
type ErrM a = Either FFeedErr a
ffeedTranslateSub :: (JSON a) => String -> FFm String -> FFm a
ffeedTranslateLs :: (JSON a) => String -> FFm String -> FFm [a]
ffeedTranslate :: (JSON a) => FFm String -> FFm a
onSuccess :: FFm () -> FFm Bool
ffeedCall :: [String] -> [(String, String)] -> FFm String
mbArg :: String -> Maybe String -> [String] -> [String]
mbArg2 :: String -> Maybe String -> [(String, String)] -> [(String, String)]
lsArg :: String -> String -> [String] -> [String]
api_base :: String
ffeed_base :: String
data FFeedErr
FFeedErr :: String -> Maybe String -> String -> FFeedErr
ffErrorCode :: FFeedErr -> String
ffErrorLoc :: FFeedErr -> Maybe String
ffErrorSource :: FFeedErr -> String
ffeedError :: FFeedErr
data SomeFFeedException
SomeFFeedException :: e -> SomeFFeedException
ffeedToException :: (Exception e) => e -> SomeException
ffeedFromException :: (Exception e) => SomeException -> Maybe e
handleFFeed :: (FFeedErr -> FFm a) -> FFm a -> FFm a
tryFFeed :: FFm a -> FFm (Either FFeedErr a)
throwFFeedErr :: FFeedErr -> FFm a
catchFFeed :: FFm a -> (FFeedErr -> FFm a) -> FFm a
instance Typeable SomeFFeedException
instance Typeable FFeedErr
instance Show FFeedErr
instance Exception FFeedErr
instance Exception SomeFFeedException
instance Show SomeFFeedException
instance Monad FFm
-- | Definition of types that the FriendFeed API uses in its responses.
module FriendFeed.Types
type UUID = String
type URLString = String
type DateString = String
type UserName = String
type ListName = String
type RoomName = String
type ServiceName = String
type UpdateToken = String
type EntryID = UUID
type CommentID = UUID
type RoomID = UUID
type ListID = UUID
type ServiceID = UUID
type UserID = UUID
nullUUID :: UUID
data Entry
Entry :: UUID -> String -> URLString -> DateString -> DateString -> Bool -> Bool -> Resource User -> Service -> [Like] -> [Comment] -> [Media] -> Maybe Via -> Maybe (Resource Room) -> Entry
entryId :: Entry -> UUID
entryTitle :: Entry -> String
entryLink :: Entry -> URLString
entryPublished :: Entry -> DateString
entryUpdated :: Entry -> DateString
entryIsHidden :: Entry -> Bool
entryIsAnon :: Entry -> Bool
entryUser :: Entry -> Resource User
entryService :: Entry -> Service
entryLikes :: Entry -> [Like]
entryComments :: Entry -> [Comment]
entryMedia :: Entry -> [Media]
entryVia :: Entry -> Maybe Via
entryRoom :: Entry -> Maybe (Resource Room)
type Via = (String, URLString)
nullVia :: Via
nullEntry :: Entry
data User
User :: String -> UserID -> UserName -> UserName -> URLString -> [Service] -> [Resource Subscription] -> [Resource Room] -> [Resource List] -> User
userStatus :: User -> String
userId :: User -> UserID
userName :: User -> UserName
userNickname :: User -> UserName
userProfileURL :: User -> URLString
userServices :: User -> [Service]
userSubscriptions :: User -> [Resource Subscription]
userRooms :: User -> [Resource Room]
userLists :: User -> [Resource List]
nullUser :: User
data Subscription
Subscription_ :: Subscription
data Comment
Comment :: DateString -> [Resource User] -> String -> Comment
commentDate :: Comment -> DateString
commentUser :: Comment -> [Resource User]
commentBody :: Comment -> String
nullComment :: Comment
data Like
Like :: DateString -> Resource User -> Like
likeDate :: Like -> DateString
likeUser :: Like -> Resource User
nullLike :: Like
data Media
Media :: Maybe String -> Maybe String -> URLString -> [Thumbnail] -> [Content] -> [Enclosure] -> Media
mediaTitle :: Media -> Maybe String
mediaPlayer :: Media -> Maybe String
mediaLink :: Media -> URLString
mediaThumbs :: Media -> [Thumbnail]
mediaContent :: Media -> [Content]
mediaEnclosure :: Media -> [Enclosure]
nullMedia :: Media
data Thumbnail
Thumbnail :: URLString -> Int -> Int -> Thumbnail
thumbUrl :: Thumbnail -> URLString
thumbWidth :: Thumbnail -> Int
thumbHeight :: Thumbnail -> Int
nullThumbnail :: Thumbnail
data Content
Content :: URLString -> String -> Int -> Int -> Content
contentUrl :: Content -> URLString
contentType :: Content -> String
contentWidth :: Content -> Int
contentHeight :: Content -> Int
nullContent :: Content
data Service
Service :: URLString -> URLString -> ServiceID -> String -> Service
serviceUrl :: Service -> URLString
serviceIconUrl :: Service -> URLString
serviceId :: Service -> ServiceID
serviceName :: Service -> String
nullService :: Service
data Enclosure
Enclosure :: URLString -> String -> Integer -> Enclosure
enclosureUrl :: Enclosure -> URLString
-- | MIME type
enclosureType :: Enclosure -> String
enclosureLength :: Enclosure -> Integer
nullEnclosure :: Enclosure
data Resource a
Resource :: UUID -> String -> String -> URLString -> Resource a
resourceId :: Resource a -> UUID
resourceName :: Resource a -> String
resourceNickname :: Resource a -> String
resourceUrl :: Resource a -> URLString
nullResource :: Resource a
data Room
Room :: String -> String -> URLString -> [Resource User] -> [Resource User] -> RoomID -> String -> String -> Room
-- | static or public
roomStatus :: Room -> String
roomDescription :: Room -> String
roomUrl :: Room -> URLString
roomAdmins :: Room -> [Resource User]
roomMember :: Room -> [Resource User]
roomId :: Room -> RoomID
roomName :: Room -> String
roomNickname :: Room -> String
nullRoom :: Room
data List
List :: ListID -> String -> String -> URLString -> [Resource User] -> [Resource Room] -> List
listId :: List -> ListID
listName :: List -> String
listNickname :: List -> String
listURL :: List -> URLString
listUsers :: List -> [Resource User]
listRooms :: List -> [Resource Room]
nullList :: List
data UpdateInfo
UpdateInfo :: UpdateToken -> Integer -> Bool -> UpdateInfo
updToken :: UpdateInfo -> UpdateToken
updInterval :: UpdateInfo -> Integer
updIncomplete :: UpdateInfo -> Bool
nullUpdateInfo :: UpdateInfo
-- | (De)serializing JSON values representing FriendFeed API data types.
module FriendFeed.Types.Import
data JM a
JM :: (String -> [(String, JSValue)] -> Result a) -> JM a
(-=>) :: a -> b -> (a, b)
runJM :: String -> [(String, JSValue)] -> JM a -> Result a
liftR :: Result a -> JM a
getLoc :: JM String
get :: String -> JM String
getInt :: String -> JM Integer
getMbS :: String -> JM (Maybe String)
getMb :: String -> JM (Maybe JSValue)
getB :: String -> JM Bool
getJSON :: String -> JM JSValue
showJS :: (a -> [(String, JSValue)]) -> a -> JSValue
readJS :: String -> a -> (JM a) -> JSValue -> Result a
readJSONs :: (JSON a) => JSValue -> Result [a]
toEntry :: String -> Result Entry
toList :: String -> Result List
showEntry :: Entry -> [(String, JSValue)]
readEntry :: JM Entry
showFFList :: List -> [(String, JSValue)]
readFFList :: JM List
readVia :: JSValue -> Result Via
showVia :: Via -> [(String, JSValue)]
showComment :: Comment -> [(String, JSValue)]
readComment :: JM Comment
showStr :: String -> JSValue
showUser :: User -> [(String, JSValue)]
readUser :: JM User
showRoom :: Room -> [(String, JSValue)]
readRoom :: JM Room
showResource :: Resource a -> [(String, JSValue)]
readResource :: JM (Resource a)
showLike :: Like -> [(String, JSValue)]
readLike :: JM Like
showEnclosure :: Enclosure -> [(String, JSValue)]
readEnclosure :: JM Enclosure
showContent :: Content -> [(String, JSValue)]
readContent :: JM Content
showThumbnail :: Thumbnail -> [(String, JSValue)]
readThumbnail :: JM Thumbnail
showMedia :: Media -> [(String, JSValue)]
readMedia :: JM Media
showService :: Service -> [(String, JSValue)]
readService :: JM Service
showUpdateInfo :: UpdateInfo -> [(String, JSValue)]
readUpdateInfo :: JM UpdateInfo
instance [overlap ok] JSON UpdateInfo
instance [overlap ok] JSON Service
instance [overlap ok] JSON Media
instance [overlap ok] JSON Thumbnail
instance [overlap ok] JSON Content
instance [overlap ok] JSON Enclosure
instance [overlap ok] JSON Room
instance [overlap ok] JSON Like
instance [overlap ok] JSON (Resource a)
instance [overlap ok] JSON User
instance [overlap ok] JSON Comment
instance [overlap ok] JSON List
instance [overlap ok] JSON Entry
instance [overlap ok] (JSON a) => Show a
instance [overlap ok] Monad JM
-- | Toplevel FriendFeed API module, including re-exports of modules
-- required to work with FriendFeed from other modules.
module FriendFeed.API
-- | Entry-specific FriendFeed API calls.
module FriendFeed.Entry
getIdEntry :: UUID -> FFm Entry
getIdEntries :: [UUID] -> FFm [Entry]
-- | Returns the entries the authenticated user would see on their
-- FriendFeed homepage - all of their subscriptions and
-- friend-of-a-friend entries.
getFriendEntries :: FFm [Entry]
getURLEntries :: URLString -> FFm [Entry]
getDomainEntries :: [String] -> Bool -> Bool -> FFm [Entry]
-- | Actions for fetching info regarding a user's FriendFeed lists.
module FriendFeed.List
-- | Returns a list of all of the list's members and the url associated
-- with the list (Authentication required):
getListProfile :: ListName -> FFm List
-- | Returns entries from the authenticated users list with the given
-- nickname:
getListEntries :: ListName -> FFm [Entry]
-- | Actions for publishing entries, comments, likes etc. to FriendFeed.
module FriendFeed.Publish
-- | Publish a new entry on the authenticated user's feed.
publishLink :: String -> URLString -> Maybe String -> FFm ()
-- | Add a comment or edit an existing comment on a FriendFeed entry.
addComment :: EntryID -> String -> FFm CommentID
-- | add a comment or edit an existing comment on a FriendFeed entry.
editComment :: EntryID -> String -> CommentID -> FFm ()
-- | delete an existing comment.
deleteComment :: EntryID -> CommentID -> FFm ()
-- | add a Like to a FriendFeed entry for the authenticated user.
addLike :: EntryID -> FFm ()
-- | delete an existing Like.
deleteLike :: EntryID -> FFm ()
-- | Delete an existing entry, but un-delete if 2nd arg is True.
deleteEntry :: EntryID -> Bool -> FFm ()
-- | Hide an entry, but un-hide/expose if 2nd arg is True.
hideEntry :: EntryID -> Bool -> FFm ()
-- | Actions for fetching info on and entries from a room.
module FriendFeed.Room
-- | Returns a list of all of the room's members and the url associated
-- with the room (Authentication required for private rooms).
getRoomProfile :: RoomName -> FFm Room
-- | Returns the entries the authenticated user would see on their Rooms
-- page - entries from all of the rooms they are members of.
getRoomsFeeds :: FFm [Entry]
-- | Returns the most recent entries in the room with the given nickname.
-- If the room is private, authentication is required.
getRoomEntries :: RoomName -> FFm [Entry]
-- | Actions for publishing entries, comments, likes etc. to FriendFeed.
module FriendFeed.Search
-- | Executes a search over the entries in FriendFeed.
searchEntries :: String -> Maybe UserName -> Maybe ServiceName -> FFm [Entry]
-- | Action for fetching the current services supported by FriendFeed.
module FriendFeed.Service
-- | Lists all services currently supported by FriendFeed.
getServices :: FFm [Service]
-- | Binding to FriendFeed API controlling subscriptions to rooms and other
-- users.
module FriendFeed.Subscribe
subscribeUser :: UserName -> FFm ()
unsubscribeUser :: UserName -> FFm ()
subscribeRoom :: RoomName -> FFm ()
unsubscribeRoom :: RoomName -> FFm ()
module FriendFeed.Updates
upd_base :: URLString
upd_base2 :: URLString
getUpdateInfo :: FFm UpdateInfo
-- | Returns updates to the users home feed.
getUpdatesHome :: UpdateToken -> Maybe Int -> FFm [Entry]
-- | Returns updates to a user's friends.
getUpdatesFriends :: UserName -> UpdateToken -> Maybe Int -> FFm [Entry]
-- | Returns updates to the authenticated user's list with the given
-- nickname.
getUpdatesList :: ListName -> UpdateToken -> Maybe Int -> FFm [Entry]
-- | Returns updates to the room with the given nickname.
getUpdatesRoom :: RoomName -> UpdateToken -> Maybe Int -> FFm [Entry]
-- | Actions for fetching entries,comments etc. for one or more
-- users/friends.
module FriendFeed.User
-- | Returns list of all of the user's subscriptions (people) and services
-- connected to their account (Authentication required for private
-- users):
getUserProfile :: UserName -> FFm User
-- | Get a user's profile picture.
getUserPicture :: UserName -> String -> FFm URLString
-- | Returns the most recent public entries on FriendFeed.
getPublicEntries :: FFm [Entry]
getUserEntries :: UserName -> FFm [Entry]
getUserComments :: UserName -> FFm [Entry]
getUserLikes :: UserName -> FFm [Entry]
-- | Returns the most recent entries the user has commented on or
-- liked.
getUserDiscussion :: UserName -> FFm [Entry]
-- | Returns entries from a user's friends.
getFriendEntries :: UserName -> FFm [Entry]
-- | Returns the most recent entries from a list of users, specified by
-- nickname.
getUsersEntries :: [UserName] -> FFm [Entry]
-- | Validates the user's remote key. If the HTTP Basic Authentication
-- nickname and remote key are valid, we return a HTTP 200 status code.
-- Otherwise, we return an HTTP 401 status code.
validateUserKey :: FFm Bool