getMostRecentPage :: UserID -> IO Link
getMostRecentPage uid = searchLast "" . ceiling . (/100)
=<< (fmap fromIntegral $ getMessages uid) where
searchLast lnk pg = do
let lnk' = concat [ hostname
, "/users/"
, uid
, "/?tab=recent&pagesize=100&page="
, show pg]
body <- getURLContent lnk'
if "monologue" `isInfixOf` body
then return lnk'