Created
June 19, 2013 03:04
-
-
Save mxswd/5811408 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Network.CGI | |
import System.IO | |
import Data.List | |
main :: IO () | |
main = runCGI (handleErrors cgiMain) | |
cgiMain = do | |
uri <- getInputs | |
let urjson = map (\(x, y) -> "\"" ++ x ++ "\": \"" ++ y ++ "\"") uri | |
let js = concat $ intersperse "," urjson | |
liftIO $ appendFile "submits.txt" $ "{" ++ js ++ "},\n" | |
output "Thanks!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment