Skip to content

Instantly share code, notes, and snippets.

@mxswd
Created June 19, 2013 03:04
Show Gist options
  • Save mxswd/5811408 to your computer and use it in GitHub Desktop.
Save mxswd/5811408 to your computer and use it in GitHub Desktop.
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