diff --git a/Handler/RootFeed.hs b/Handler/RootFeed.hs index afc0ba8..f93f4d7 100644 --- a/Handler/RootFeed.hs +++ b/Handler/RootFeed.hs @@ -185,9 +185,25 @@ getCommentFeedR :: RepFeed a => MediumId -> Handler a getCommentFeedR mediumId = do medium <- runDB $ get404 mediumId url <- getUrlRender - recentComments <- runDB $ selectList [CommentOrigin ==. mediumId] [Desc CommentTime, LimitTo 10] + recentComments <- runDB $ selectList [CommentOrigin ==. mediumId] [Desc CommentTime, LimitTo 100] renderFeed Parameters { pTitle = "Eidolon :: Newest comments on " `T.append` (mediumTitle medium) , pLink = MediumR mediumId , pImage = url $ StaticR $ mediumStaticThumbRoute medium } (Left recentComments) + +getUserFeedAtomR :: UserId -> Handler RepAtom +getUserFeedAtomR = getUserFeedR + +getUserFeedRssR :: UserId -> Handler RepRss +getUserFeedRssR = getUserFeedR + +getUserFeedR :: RepFeed a => UserId -> Handler a +getUserFeedR userId = do + user <- runDB $ get404 userId + recentMedia <- runDB $ selectList [MediumOwner ==. userId] [Desc MediumTime, LimitTo 100] + renderFeed Parameters + { pTitle = "Eidolon :: Newest media of " `T.append` (userSlug user) + , pLink = ProfileR userId + , pImage = "" + } (Right recentMedia) diff --git a/config/routes b/config/routes index 77b3983..c46e6f4 100644 --- a/config/routes +++ b/config/routes @@ -46,3 +46,5 @@ /feed/album/#AlbumId/rss.xml AlbumFeedRssR GET /feed/medium/#MediumId/atom.xml CommentFeedAtomR GET /feed/medium/#MediumId/rss.xml CommentFeedRssR GET +/feed/user/#UserId/atom.xml UserFeedAtomR GET +/feed/user/#UserId/rss.xml UserFeedRssR GET diff --git a/templates/profile.hamlet b/templates/profile.hamlet index d9082bc..670bebb 100644 --- a/templates/profile.hamlet +++ b/templates/profile.hamlet @@ -43,3 +43,7 @@ $else
#{mediumTitle medium} + +get a feed from this: + Atom + RSS