 class TwitterOAuth
   @HEX : '0123456789ABCDEF'
   @URL:{
-    BASE_URL: "api.twitter.com",
-    REQUEST_TOKEN: "https://api.twitter.com/oauth/request_token",
-    ACCESS_TOKEN: "https://api.twitter.com/oauth/access_token",
+    BASE: "api.twitter.com",
+    REQUEST: "https://api.twitter.com/oauth/request_token",
+    REQUEST_PATH : "/oauth/request_token",
+    ACCESS: "https://api.twitter.com/oauth/access_token",
+    ACCESS_PATH: "/oauth/access_token"
     AUTHORIZE: "https://api.twitter.com/oauth/authorize",
+    POST_PATH: "/1.1/statuses/update.json",
+    POST: "https://api.twitter.com/1.1/statuses/update.json",
   }
   constructor: (@_options={ consumer_key:"", consumer_secret_key:"", callback:"", access_token:"", access_token_secret:"" }) ->
     @consumer_key = @_options["consumer_key"]

      return
    access_token_secret = robot.brain.get("#{user.id}:twitter:access_token_secret_t")
    oauth = new TwitterOAuth({consumer_key:TWITTER_CONSUMER_KEY, consumer_secret_key:TWITTER_CONSUMER_SECERT_KEY, callback:TWITTER_CALLBACK_URL})
    oauth.verify_oauth access_token, access_token_secret, oauth, (oa)=>
      robot.brain.set("#{user.id}:twitter:access_token", oa.access_token)
      robot.brain.set("#{user.id}:twitter:access_token_secret", oa.access_token_secret)
      robot.brain.remove "twitter:#{access_token}" 
      robot.brain.remove "#{user.id}:twitter:access_token_t"
      robot.brain.remove "#{user.id}:twitter:access_token_secret_t" 
      draft = robot.brain.get "#{user.id}:twitter:draft"
      if draft?
        room = robot.adapter.client.rtm.dataStore.getDMByName user.name
        robot.reply {room:room.id, user: user}, "I'm posting that tweet: #{draft}"

    res.send 'OK'
    
    

    res.reply "Twitter's oAuth has been removed"
  
  robot.router.all '/twitter/oauth(/)?', (req, res) ->
    query = QUERY_STRING.parse(url.parse(req.url).query)
    access_token = query["oauth_token"]
    oauth_verifier = query["oauth_verifier"]
