updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / dtwitzen / http4.diff
blobe09806aeb39c94071981640f13e0c06fef1389c5
1 diff -Naur dtwitzen-0.2/Request.hs dtwitzen-0.2/Request.hs
2 --- dtwitzen-0.2/Request.hs 2008-08-10 07:38:59.000000000 +0300
3 +++ dtwitzen-0.2/Request.hs 2009-09-08 14:00:59.741501368 +0300
4 @@ -8,6 +8,7 @@
5 import System.Environment
6 import Network.Browser
7 import Network.HTTP
8 +import Network.Stream
9 import Network.URI
11 data Account = MkAccount { acUsername :: String
12 @@ -15,18 +16,18 @@
14 deriving (Show, Read)
16 -reqTimeline :: Account -> IO (Result Response)
17 -reqTimeline = httpRequest . mkRequest
18 +reqTimeline :: Account -> IO (Result (Response String))
19 +reqTimeline = httpRequest . mkTwitterRequest
21 -mkRequest :: Account -> (Request, Account)
22 -mkRequest ac = (Request { rqURI = uri
23 +mkTwitterRequest :: Account -> (Request String, Account)
24 +mkTwitterRequest ac = (Request { rqURI = uri
25 , rqMethod = GET
26 , rqHeaders = [Header HdrHost "twitter.com"]
27 , rqBody = "" }
28 ,ac)
29 where uri = fromJust $ parseURI $ "http://twitter.com/statuses/friends_timeline/"++(acUsername ac)++".xml"
31 -httpRequest :: (Request, Account) -> IO (Result Response)
32 +httpRequest :: (Request String, Account) -> IO (Result (Response String))
33 httpRequest (req,account)
34 = do
35 proxy <- catch