Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixed examples #2

Merged
merged 4 commits into from

2 participants

Jonathan Gottfried paolo fragomeni
Jonathan Gottfried

Updated examples/simple-sms and README to actually have functional examples.

paolo fragomeni hij1nx merged commit f3845f6 into from
paolo fragomeni
Owner

crap, i keep meaning to work on this.

Jonathan Gottfried

No worries, someone was using telenode at the nodejitsu hackathon yesterday and couldn't figure out what to do so I figured I'd update the example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 20 additions and 10 deletions.
  1. +11 −3 README.md
  2. +9 −7 examples/simple-sms.js
14 README.md
View
@@ -19,10 +19,18 @@ Everything else sucks
var Telenode = require('telenode');
var client = new Telenode(Telenode.providers.twilio);
+client.credentials({
+ sid: 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
+ authToken: 'YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY'
+});
+
client.SMS.send({
- from: '+1-917-123-9876',
- to: '+1-917-123-9876',
- body: 'Hello'
+ from: '+19171239876',
+ to: '+19171239876',
+ body: 'Hello World'
+}, function(err, body) {
+ if (err) throw err;
+ console.log('Body: ' + body);
});
```
16 examples/simple-sms.js
View
@@ -1,5 +1,4 @@
-
-var Telenode = require('../lib/telenode');
+var Telenode = require('telenode');
var client = new Telenode(Telenode.providers.twilio);
client.credentials({
@@ -8,8 +7,8 @@ client.credentials({
// add these two things however you want, if you
// do not have them, just signup at `twilio.com`.
//
- sid: '',
- token: ''
+ sid: 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
+ authToken: 'YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY'
});
//
@@ -20,16 +19,19 @@ client.SMS.send({
//
// put your twillio phone number here.
//
- from: '+1-111-111-1111',
+ from: '+19171239876',
//
// put your cell phone number here.
//
- to: '+1-111-111-1111',
+ to: '+19171239876',
//
// some message goes here.
//
- body: 'Hello'
+ body: 'Hello World'
+}, function(err, body) {
+ if (err) throw err;
+ console.log('Body: ' + body);
});
Something went wrong with that request. Please try again.