Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stonecypher/twilierl
Twilierl is a Twilio client for erlang.
https://github.com/stonecypher/twilierl
Last synced: 21 days ago
JSON representation
Twilierl is a Twilio client for erlang.
- Host: GitHub
- URL: https://github.com/stonecypher/twilierl
- Owner: StoneCypher
- License: mit
- Created: 2013-10-27T02:01:46.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-11-10T04:10:22.000Z (about 11 years ago)
- Last Synced: 2024-10-26T11:51:49.280Z (2 months ago)
- Language: Erlang
- Size: 124 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
twilierl
========Twilierl is a Twilio client for erlang. Send SMSes from your REPL for [a couple cents](https://www.twilio.com/sms/pricing). Woo.
So far it only does SMS sending. No MMS, no media messages, no calls, etc, yet.
Usage
-----Get your SID, Auth, and sender phone number from your control panel in your Twilio account. (The free one will do, but it'll only SMS you.)
```erlang
1> SID = "41a3...".
"41a3..."2> Auth = "4qn4t..."
"4qn4t..."3> SendNumber = 6195550121.
61955501214> twilierl:send(SID, Auth, SendNumber, 4125550138, "This is a message sent from San Diego to Pittsburgh", undefined).
{ok,{{"HTTP/1.1",201,"CREATED"},
[{"connection","close"},
{"date","Sun, 27 Oct 2013 04:00:28 GMT"},
{"content-length","675"},
{"content-type","application/json"},
{"x-powered-by","AT-5000"},
{"x-shenanigans","none"}],
"{\"sid\": \"SM069...\", \"date_created\": \"Sun, 27 Oct 2013 04:00:28 +0000\", \"date_updated\": \"Sun, 27 Oct 2013 04:00:28 +0000\", \"date_sent\": null, \"account_sid\": \"41a3...\", \"to\": \"+14125550138\", \"from\": \"+16195550121\", \"body\": \"aouheo\", \"status\": \"queued\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"outbound-api\", \"api_version\": \"2010-04-01\", \"price\": null, \"uri\": \"/2010-04-01/Accounts/41a3.../Messages/SM069....json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/41a3.../Messages/SM069.../Media.json\"}}"}}
```Pow.
Making it simpler
-----------------Wrap your credentials up.
```erlang
5> MySend = fun(Num, Msg) -> twilierl:send(SID, Auth, SendNumber, Num, Msg, undefined) end.
#Fun6> MySend(4125550138, "I sent you a second message, lol").
{ok,{{"HTTP/1.1",201,"CREATED"},
[{"connection","close"},
{"date","Sun, 27 Oct 2013 04:00:28 GMT"},
{"content-length","675"},
{"content-type","application/json"},
{"x-powered-by","AT-5000"},
{"x-shenanigans","none"}],
"{\"sid\": \"SM069...\", \"date_created\": \"Sun, 27 Oct 2013 04:00:28 +0000\", \"date_updated\": \"Sun, 27 Oct 2013 04:00:28 +0000\", \"date_sent\": null, \"account_sid\": \"41a3...\", \"to\": \"+14125550138\", \"from\": \"+16195550121\", \"body\": \"aouheo\", \"status\": \"queued\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"outbound-api\", \"api_version\": \"2010-04-01\", \"price\": null, \"uri\": \"/2010-04-01/Accounts/41a3.../Messages/SM069....json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/41a3.../Messages/SM069.../Media.json\"}}"}}
```Some notes
----------You should have a [Twilio account](http://www.twilio.com/) set up for this.