def get_token(url)
      req      = Net::HTTP::Post.new('/', initheader = {'Content-Type' => 'application/json'})
      req.body = {url: url, format: 'json'}.to_json

      res = @http.request(req)
      data = JSON::parse(res.body)
      data['trunct']['token']
    end
def get_token(url)
      req      = Net::HTTP::Post.new('/', initheader = {'Content-Type' => 'application/json'})
      req.body = {url: url, format: 'json'}.to_json

      res = @http.request(req)
      data = JSON::parse(res.body)
      data['trunct']['token']
    end
Shortens a URL, returns the shortened token