Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
|
|
@ -17,7 +17,7 @@ getRespons url = do
|
|||
|
||||
mostPopLang = do
|
||||
rsp <-getRespons $ "http://www.rosettacode.org/w/api.php?action=query&list=" ++
|
||||
"categorymembers&cmtitle=Category:Programming_Languages&cmlimit=500&format=xml"
|
||||
"categorymembers&cmtitle=Category:Programming_Languages&cmlimit=500&format=xml"
|
||||
mbrs <- getRespons "http://www.rosettacode.org/w/index.php?title=Special:Categories&limit=5000"
|
||||
let xmls = onlyElems $ parseXML rsp
|
||||
langs = concatMap (map ((\\"Category:"). fromJust.findAttr (unqual "title")). filterElementsName (== unqual "cm")) xmls
|
||||
|
|
@ -27,9 +27,9 @@ mostPopLang = do
|
|||
catNmbs = map catMbr $ filter (isPrefixOf "<li>") $ lines mbrs
|
||||
printFmt (n,(l,m)) = putStrLn $ take 6 (show n ++ ". ") ++ (show m) ++ " " ++ l
|
||||
toMaybe (a,b) =
|
||||
case b of
|
||||
Just x -> Just (a,x)
|
||||
_ -> Nothing
|
||||
case b of
|
||||
Just x -> Just (a,x)
|
||||
_ -> Nothing
|
||||
|
||||
mapM_ printFmt $ zip [1..] $ sortBy (flip (comparing snd))
|
||||
$ mapMaybe (toMaybe. (id &&& flip lookup catNmbs)) langs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue