-- | Given username's last status id, constructs the API URL for
-- username's new statuses. Essentially, 'user_timeline_url' with a
-- "since_id" parameter tacked on.
user_new_statuses_url :: String -> Integer -> String
user_new_statuses_url username last_status_id =
-- | Given username's last status id, constructs the API URL for
-- username's new statuses. Essentially, 'user_timeline_url' with a
-- "since_id" parameter tacked on.
user_new_statuses_url :: String -> Integer -> String
user_new_statuses_url username last_status_id =
- concat [ user_timeline_url username,
- "&since_id=" ++ (show last_status_id) ]
-
-
-get_status :: Integer -> IO B.ByteString
-get_status status_id = do
- let uri = status_url status_id
- http_get uri
+ url ++ "&since_id=" ++ since_id
+ where
+ url = user_timeline_url username
+ since_id = show last_status_id
-get_user_new_statuses :: String -> Integer -> IO B.ByteString
-get_user_new_statuses username last_status_id = do
+get_user_new_statuses :: Cfg -> String -> Integer -> IO B.ByteString
+get_user_new_statuses cfg username last_status_id = do
- consumer_key = BC.pack ""
- consumer_secret = BC.pack ""
- access_token = BC.pack ""
- access_secret = BC.pack ""
+ consumer_key' = BC.pack (consumer_key cfg)
+ consumer_secret' = BC.pack (consumer_secret cfg)
+ access_token' = BC.pack (access_token cfg)
+ access_secret' = BC.pack (access_secret cfg)
- oauthConsumerKey = consumer_key,
- oauthConsumerSecret = consumer_secret
+ oauthConsumerKey = consumer_key',
+ oauthConsumerSecret = consumer_secret'