Created
April 15, 2014 11:05
-
-
Save osnr/10723233 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Http | |
import Graphics.Input as I | |
import Graphics.Input.Field as F | |
inp : I.Input F.Content | |
inp = I.input F.noContent | |
urlify : String -> String | |
urlify t = "http://en.wikipedia.org/w/api.php?action=query&format=json&callback=?&titles=" ++ t ++ "&prop=revisions&rvprop=content" | |
page : Signal String -> Signal Element | |
page s = asText <~ (Http.sendJsonp <| lift urlify s) | |
main = lift2 above | |
(F.field F.defaultStyle inp.handle id "Page_title" <~ inp.signal) | |
(page (lift .string inp.signal)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment