diff options
author | Vincent Ambo <tazjin@googlemail.com> | 2012-03-23T23·32+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@googlemail.com> | 2012-03-23T23·32+0100 |
commit | efbec9ff76ada0e59f8fc5c37a4c2734ccbf7ce2 (patch) | |
tree | 1b61546620799319152f27c08aeefab3321335db /src/BlogDB.hs | |
parent | a405e185bac6673645d96defb3800b7a18ca351d (diff) |
* added RSS.hs: functions to create an RSS feed
* added RSS feed handler * FromReqURI instance for BlogLang * fixed RSS-feed link
Diffstat (limited to 'src/BlogDB.hs')
-rw-r--r-- | src/BlogDB.hs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/BlogDB.hs b/src/BlogDB.hs index 7a4f869eb71b..ea574c70842b 100644 --- a/src/BlogDB.hs +++ b/src/BlogDB.hs @@ -9,14 +9,16 @@ import Data.Acid import Data.Acid.Advanced import Data.Acid.Local import Data.ByteString (ByteString) +import Data.Char (toLower) import Data.Data (Data, Typeable) import Data.IxSet (Indexable(..), IxSet(..), (@=), Proxy(..), getOne, ixFun, ixSet) -import Data.List (insert) +import Data.List (insert) import Data.SafeCopy (SafeCopy, base, deriveSafeCopy) import Data.Text (Text, pack) import Data.Text.Lazy (toStrict) import Data.Time -import System.Environment(getEnv) +import Happstack.Server (FromReqURI(..)) +import System.Environment (getEnv) import qualified Crypto.Hash.SHA512 as SHA (hash) import qualified Data.ByteString.Char8 as B @@ -38,6 +40,13 @@ instance Show BlogLang where show DE = "de" show EN = "en" +instance FromReqURI BlogLang where + fromReqURI sub = + case map toLower sub of + "de" -> Just DE + "en" -> Just EN + _ -> Nothing + $(deriveSafeCopy 0 'base ''BlogLang) data Comment = Comment { |