View app.rb
require 'sinatra'
require 'twilio-ruby'
sid = ''
tkn = ''
app_sid = ''
capability = Twilio::Util::Capability.new sid, tkn
capability.allow_client_outgoing(app_sid)
View example.jade
html
head
title Socket.io Example
body
h1(class="something") Socket.io Example
input#msg(type="text")
button send message
#messages
View readme.md

Proposal for JavaScript SDK packaging

Right now, the Twilio client-side SDKs feel like they are designed and shipped by dozens of people. By making some changes to the Twilio SDK CDN and our module sructure, we could address some of these issues.

Include the latest everything from CDN

For onboarding and getting started, we could include a "kitchen sink" artefact that bundles up the latest version of every Twilio client-side SDK.

<script src="//media.twiliocdn.com/js/twilio.min.js"></script>
View Example.java
// Install the Java helper library from twilio.com/docs/java/install
import org.joda.time.LocalDate;
import com.twilio.rest.Twilio;
import com.twilio.rest.resource.api.v2010.account.call.FeedbackSummary;
public class Example {
// Find your Account Sid and Token at twilio.com/user/account
public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
public static final String AUTH_TOKEN = "your_auth_token";
View Example.java
// Install the Java helper library from twilio.com/docs/java/install
import java.net.URI;
import java.net.URISyntaxException;
import com.twilio.rest.Twilio;
import com.twilio.rest.creator.api.v2010.account.CallCreator;
import com.twilio.rest.resource.api.v2010.account.Call;
import com.twilio.rest.type.PhoneNumber;
public class Example {
View example.js
var t = new twilio.TwimlResponse();
t.dial((dial) => {
dial.number('+16518675309');
});
View example.js
var accountSid = '{{ YOUR_ACCOUNT_SID }}';
var authToken = '{{ YOUR_AUTH_TOKEN }}';
var LookupsClient = require('twilio').LookupsClient;
var client = new LookupsClient(accountSid, authToken);
var phoneNumber = process.argv[2];
client.phoneNumbers(phoneNumber).get({
type: 'carrier'
}, (error, number) => {
var message = number ? number.national_format + ' is valid' : error;
View one_request.py
# Download the 'Preview Release' version of the Python helper library from
# twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/user/account
account = 'AC421124bfab3052ad108f3e8c7a119cfb'
token = 'AUTH_TOKEN'
client = Client(account, token)
# Delete the service
View actual.js
// Load user year data
$.ajax('/ga/users').then(function(data) {
// Populate raw numbers
var usersYearFormatted = humanize.numberFormat(data.usersThisYear, 0);
var usersQuarterFormatted = humanize.numberFormat(data.usersThisQuarter,
0);
$('.users-year').text(usersYearFormatted);
$('.users-quarter').text(usersQuarterFormatted);
// Populate progress bar
$quarterGoal = $('.progress.current-goal .progress-bar');
View index.js
var http = require('http');
var express = require('express');
var bodyParser = require('body-parser');
var KeenClient = require('keen-js');
// 1.) create an authenticated Keen analytics client
var keen = new KeenClient({
projectId: 'your project ID here',
writeKey: 'your write key here'
});