module FriendFeed.Publish where
import FriendFeed.Types
import FriendFeed.Types.Import ()
import FriendFeed.Monad
import Data.Maybe
publishLink :: String
-> URLString
-> Maybe String
-> FFm ()
publishLink title l mbComment = postMethod $ authCall $
ffeedCall_ ["share"]
[ ("title", title)
, ("link", l)
, ("comment", fromMaybe "" mbComment)
]
addComment :: EntryID -> String -> FFm CommentID
addComment entry body = postMethod $
ffeedTranslate $
ffeedCall ["comment"]
[ ("entry", entry)
, ("body", body)
]
editComment :: EntryID -> String -> CommentID -> FFm ()
editComment entry body c = postMethod $
ffeedCall_ ["comment"]
[ ("entry", entry)
, ("body", body)
, ("comment", c)
]
deleteComment :: EntryID -> CommentID -> FFm ()
deleteComment entry c = postMethod $
ffeedCall_ ["comment","delete"]
[ ("entry", entry)
, ("comment", c)
]
addLike :: EntryID -> FFm ()
addLike e = authCall $ postMethod $
ffeedCall_ ["like"]
[("entry",e)]
deleteLike :: EntryID -> FFm ()
deleteLike e = authCall $ postMethod $
ffeedCall_ ["like","delete"]
[("entry",e)]
deleteEntry :: EntryID -> Bool -> FFm ()
deleteEntry e unDel = authCall $
ffeedCall_ ["entry","delete"]
((if unDel then (("undelete","1"):) else id)
[("entry",e)])
hideEntry :: EntryID -> Bool -> FFm ()
hideEntry e unDel = authCall $
ffeedCall_ ["entry","hide"]
((if unDel then (("unhide","1"):) else id)
[("entry",e)])