Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 28 lines (20 sloc) 0.76 kb
#!/usr/bin/env runhaskell
\begin{code}
import Text.HTML.Download
import Text.HTML.TagSoup
import Network.URL
import Control.Monad
uSER = "batterseapower"
pROJECT_NAME = "edit-distance"
rEADME_PAGE = "readme"
rEADME_FILENAME = "README.textile"
encURL :: String -> String
encURL = encString False ok_url
gitHubEditWikiURL :: String -> String -> String -> String
gitHubEditWikiURL user project page = encURL $ "http://github.com/" ++ user ++ "/" ++ project ++ "/wikis/" ++ page ++ "/edit"
main :: IO ()
main = do
tags <- liftM parseTags $ openURL (gitHubEditWikiURL uSER pROJECT_NAME rEADME_PAGE)
let text = innerText $ takeWhile (~/= "</textarea>") $ head $ sections (~== "<textarea id=wiki_body>") tags
writeFile rEADME_FILENAME text
\end{code}
Jump to Line
Something went wrong with that request. Please try again.