Hacker News new | ask | show | jobs
by kondro 4642 days ago
Trivial puzzle, but I have no desire to ever work for BigCommerce.

  require 'sinatra'
  require 'twilio-ruby'

  ACCOUNT_SID = "Your SID"
  AUTH_TOKEN = "Your Token"
  BIG_COMMERCE_NUMBER = "+612#{1bp49b".to_i(36)}"
  APP_URL = "http://path.to.this.app.com"
  YOUR_NUMBER = "+61211111111"

  get '/' do
    twilio = Twilio::REST::Client.new(ACCOUNT_SID, AUTH_TOKEN)
    twilio.account.calls.create(
      from: YOUR_NUMBER, 
      to: BIG_COMMERCE_NUMBER
      url: APP_URL + "/give-me-a-job"
    )
  end

  get '/give-me-a-job" do
    r.Dial callerId: YOUR_NUMBER do |d|
      d.Number(CGI.escape(YOUR_NUMBER))
    end
  end