Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Haskell by dabino ( 13 years ago )
main = do
src <- openURL "http://www.bloomberg.com/rapi/homepage/non_stop_news"
--let rv = parseJSON (L.unpack src)
--print rv
let js src
let r2=decode json :: Result [JSObject JSValue]
let qs = case r2 of
Ok val -> val
Error e -> error e
let ss=Prelude.map getNews qs
handle1 <- openFile "bloombernews.txt" ReadMode
contents <- L.hGetContents handle1
let ns = L.lines $ contents
let strnews = Prelude.map (\x->L.drop 29 x) (Prelude.drop (Prelude.length ns - 500) ns)
hClose handle1
Revise this Paste