Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- suggestedPostsFor userId = do
- friendIds <- friendsOf userId -- Get the friends of the current user
- topics <- favoriteTopicsOf userId -- Get the favorite topics of the current user
- friendsPosts <- forM friendIds $ \friendId -> do -- For each friend
- posts <- lastPostsOf friendId -- * Get their last posts
- return (filter (isAbout topics) posts) -- * Keep those whose topic is relevant
- return (mostLiked 3 friendsPosts) -- Rank them to keep only the bests
Add Comment
Please, Sign In to add comment