From da2fd044fce8bd3cc5eb4456c28414286d409df8 Mon Sep 17 00:00:00 2001 From: Ian Date: Tue, 10 Mar 2015 23:51:52 -0700 Subject: [PATCH 1/5] Set a default 'from' address that is not textbelt.com --- lib/text.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/text.js b/lib/text.js index c71df37..dd6a462 100644 --- a/lib/text.js +++ b/lib/text.js @@ -4,6 +4,7 @@ var providers = require('./providers.js') , spawn = require('child_process').spawn; var debugEnabled = false; +var fromAddress = 'foo@bar.com'; //---------------------------------------------------------------- /* @@ -56,7 +57,7 @@ function sendText(phone, message, region, cb) { _.each(providers_list, function(provider) { var email = provider.replace('%s', phone); email = 'Subject: Text\r\n\r\n' + email; - var child = spawn('sendmail', ['-f', 'txt2@textbelt.com', email]); + var child = spawn('sendmail', ['-f', fromAddress, email]); child.stdout.on('data', output); child.stderr.on('data', output); child.on('error', function(data) { From 084649c998a620e5ffcdc8244bb0e3c2e1f24eba Mon Sep 17 00:00:00 2001 From: Ravin Sardal Date: Sat, 9 May 2015 15:16:33 -0700 Subject: [PATCH 2/5] Fixed Connect 3.0 Deprication Issue --- server/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/app.js b/server/app.js index 8a5d9b7..0f4c50d 100644 --- a/server/app.js +++ b/server/app.js @@ -16,7 +16,8 @@ app.set('view engine', 'jade'); app.use(express.cookieParser()); app.use(express.static(__dirname + '/public')); -app.use(express.bodyParser()); +app.use(express.json()); +app.use(express.urlencoded()); // Enable log messages when sending texts. text.debug(true); From d50410afee343834b5b2231cfbeb9c6e11ae484d Mon Sep 17 00:00:00 2001 From: Ian Webster Date: Tue, 21 Jul 2015 23:54:21 -0700 Subject: [PATCH 3/5] Clarify meaning of success in README and site. Fixes #44 --- README.md | 4 ++++ server/views/index.html | 3 +++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index e9b50e9..aee6bf1 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,8 @@ Sample success: {"success":true} ``` +Note that success means that the message was sent to Textbelt's list of providers. We can't guarantee delivery on your network. + Sample failure: ``` @@ -74,6 +76,8 @@ Canadian and international support may not be complete. Refer to the list of su ### Notes and Limitations + * Some carriers are picky about which messages they deliver. A "success" response from Textbelt means that your message was given to the carrier. + * IP addresses are limited to 75 texts per day. Phone numbers are limited to 3 texts every 3 minutes. If you need increased limits, please contact admin@textbelt.com. * Some carriers may deliver text messages from "txt@textbelt.com" diff --git a/server/views/index.html b/server/views/index.html index 9c6b99a..ad5b970 100644 --- a/server/views/index.html +++ b/server/views/index.html @@ -53,6 +53,8 @@ body {
{"success":true}
 
+

Note that success means that the message was sent to Textbelt's list of providers. We can't guarantee delivery on your network.

+

Sample failure:

{"success":false,"message":"Exceeded quota for this phone number."}
@@ -79,6 +81,7 @@ Canadian and international support may not be complete.  Please refer to the lis
 

Notes and Limitations

    +
  • Some carriers are picky about which messages they deliver. A "success" response from Textbelt means that your message was given to the carrier.

  • IP addresses are limited to 75 texts per day. Phone numbers are limited to 3 texts every 3 minutes. To report abuse or request increased limits, please contact ianw_textbelt at ianww.com.

  • Some carriers may deliver text messages from "txt@textbelt.com"

  • Supported U.S. carriers: Alltel, Ameritech, AT&T Wireless, Boost, CellularOne, Cingular, Edge Wireless, Sprint PCS, Telus Mobility, T-Mobile, Metro PCS, Nextel, O2, Orange, Qwest, Rogers Wireless, US Cellular, Verizon, Virgin Mobile.

  • From 2de59bb48dd3f007cb7eb4773404a124004cc6aa Mon Sep 17 00:00:00 2001 From: Ian Webster Date: Sun, 6 Sep 2015 08:18:14 -0700 Subject: [PATCH 4/5] Clarify what textbelt is in README. Fixes #48. --- README.md | 4 +++- server/views/index.html | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aee6bf1..31898a9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ ### TextBelt -TextBelt (http://textbelt.com) is an outgoing SMS API that uses carrier-specific gateways to deliver your text messages for free, and without ads. The service is fairly reliable and has sent over 100,000 texts. +TextBelt (http://textbelt.com) is a REST API that sends outgoing SMS. It is available as a public service or as an internally self-hosted server. + +Textbelt uses carrier-specific gateways to deliver your text messages for free, and without ads. The service is fairly reliable and has sent over 1 million texts. Send a text with a simple POST request: diff --git a/server/views/index.html b/server/views/index.html index ad5b970..1ca1462 100644 --- a/server/views/index.html +++ b/server/views/index.html @@ -35,7 +35,13 @@ body { -

    TextBelt is an outgoing SMS API that uses carrier-specific gateways to deliver your text messages for free, and without ads. The service is fairly reliable and has sent over 100,000 texts.

    +

    +TextBelt is a REST API that sends outgoing SMS. It is available as a public service or as an internally self-hosted server. +

    + +

    +Textbelt uses carrier-specific gateways to deliver your text messages for free, and without ads. The service is fairly reliable and has sent over 1 million texts. +

    Send a text with a simple POST request:

    From b9fb645bac29a389ac43b7f9aed998fe9b5f8058 Mon Sep 17 00:00:00 2001 From: Ian Webster Date: Sun, 6 Sep 2015 08:20:43 -0700 Subject: [PATCH 5/5] Enable CORS so sites can use directly in JS. Fixes #43. --- server/app.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/app.js b/server/app.js index 0f4c50d..cc6c4fa 100644 --- a/server/app.js +++ b/server/app.js @@ -18,6 +18,12 @@ app.use(express.cookieParser()); app.use(express.static(__dirname + '/public')); app.use(express.json()); app.use(express.urlencoded()); +app.use(function(req, res, next) { + // Enable CORS so sites can use the API directly in JS. + res.header('Access-Control-Allow-Origin', '*'); + res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept'); + next(); +}); // Enable log messages when sending texts. text.debug(true);