       .toString("base64").slice(0, bits)
       .replace(/\+/g, '0').replace(/\//g, '0')
   
-  http: (url, options) ->
-    HttpClient.create(url, @extend({}, options))
   
   sort_options: (options =[]) ->
     options.sort (a, b)->

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",
    AUTHORIZE: "https://api.twitter.com/oauth/authorize",
  }
  constructor: (@_options={ consumer_key:"", consumer_secret_key:"", callback:"", access_token:"", access_token_secret:"" }) ->
    @consumer_key = @_options["consumer_key"]

    access_token = robot.brain.get "#{user.id}:twitter:access_token"
    access_token_secret = robot.brain.get "#{user.id}:twitter:access_token_secret" 
    if access_token?
      oauth = new TwitterOAuth({consumer_key:TWITTER_CONSUMER_KEY,consumer_secret_key:TWITTER_CONSUMER_SECERT_KEY, 
                  access_token:access_token, access_token_secret:access_token_secret})
      res.reply "I'm posting that tweet: #{tweet}"
       #tweet with oauth
    else
      robot.brain.set("#{user.id}:twitter:draft", tweet)
      oauth = new TwitterOAuth({consumer_key:TWITTER_CONSUMER_KEY, consumer_secret_key:TWITTER_CONSUMER_SECERT_KEY, callback: TWITTER_CALLBACK_URL})
      oauth.request_token (oa, verify_url) =>
        robot.brain.set("#{user.id}:twitter:access_token_t", oa.access_token)
        robot.brain.set("#{user.id}:twitter:access_token_secret_t", oa.access_token_secret)
        robot.brain.set("twitter:#{oa.access_token}", user)
