-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6e20a1d
Showing
8 changed files
with
205 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*.db | ||
.DS_Store | ||
.project | ||
ssl | ||
node_modules | ||
.metadata | ||
*.tmproj | ||
*.sublime-project | ||
dump.rdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{exec} = require 'child_process' | ||
|
||
task 'watch', 'Watch CS File Changes and Compile right away', -> | ||
exec 'coffee --watch --bare --compile --output lib/ src/', (err, stdout, stderr) -> | ||
throw err if err |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
CoolSMS-node | ||
===== | ||
|
||
--- | ||
|
||
## Installation | ||
|
||
<pre> | ||
npm install coolsms | ||
</pre> | ||
|
||
or | ||
|
||
<pre> | ||
git clone git://github.com/InspiredJW/coolsms.git | ||
</pre> | ||
|
||
## Usage | ||
|
||
```javascript | ||
var coolsms = require('coolsms'); | ||
|
||
coolsms({ | ||
ssl: true, // true | false | ||
user: 'username', // CoolSMS username | ||
password: 'password', // CoolSMS password | ||
to: '01000000000', // Recipient Phone Number | ||
from: '01000000000', // Sender Phone Number | ||
text: 'Hello World!' // Text to send | ||
}, function(err, result) { | ||
// error message in String and result information in JSON | ||
if (err) { | ||
console.log(err); | ||
} | ||
console.log(body); | ||
}); | ||
|
||
``` | ||
|
||
## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* | ||
* CoolSMS - Node.js | ||
* Copyright (c) 2012 InspiredJW <inspired.jw@gmail.com> | ||
* MIT Licensed | ||
*/ | ||
module.exports = require('./lib/coolsms'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "coolsms", | ||
"description": "coolsms for Node.js", | ||
"version": "1.0.0", | ||
"author": "InspiredJW <inspired.jw@gmail.com>", | ||
"keywords": ["coolsms", "sms", "text", "mobile"], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/InspiredJW/coolsms.git" | ||
}, | ||
"dependencies": { | ||
"request": "*", | ||
"underscore": "*" | ||
}, | ||
"main": "index", | ||
"engines": { "node": ">= 0.6.0" } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
crypto = require "crypto" | ||
request = require "request" | ||
_ = require "underscore" | ||
|
||
module.exports = (input, callback) -> | ||
options = | ||
uri: '//api.coolsms.co.kr/sendmsg' | ||
ssl: false | ||
user: 'user' | ||
password: 'password' | ||
enc: 'md5' | ||
to: '' | ||
from: '' | ||
text: '' | ||
|
||
options = _.extend options, input | ||
|
||
options.password = crypto | ||
.createHash(options.enc) | ||
.update(options.password) | ||
.digest("hex") | ||
|
||
request.post | ||
uri: (if options.ssl then "https:" else "http:") + options.uri | ||
form: | ||
user: options.user | ||
password: options.password | ||
enc: options.enc | ||
to: options.to | ||
from: options.from | ||
text: options.text | ||
, (err, res, body) -> | ||
messages = {} | ||
lines = body.split '\n' | ||
for line in lines | ||
part = line.split '=' | ||
messages[part[0]] = part[1] if part[0].trim().length > 0 | ||
|
||
callback err, messages |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.