sms-by-luosima

send SMS by LuoSiMao service

Usage no npm install needed!

<script type="module">
  import smsByLuosima from 'https://cdn.skypack.dev/sms-by-luosima';
</script>

README

sms-by-luosima

Send SMS by LuoSiMao service

LuoSiMao is a web service to provide API gateway send SMS including text and voice format to mobile phone in China.

This program just packaged its API and make them more convenient way to use.

Preparation

Install with:

npm install sms-by-luosima

Alternative way with:

git clone https://github.com/baohanddd/sms-by-luosima.git ./sms

Usage


var redis = require("redis")
    , subscriber = redis.createClient()
    , service = require('./luosimao.js');

service.sign = "orginazation-name";
service.key  = "your-api-key";

subscriber.on("message", function(channel, message) {
    var data = JSON.parse(message);
    console.log('send "'+data.message+'" to ' + data.mobile);
    service.send(data);
});

subscriber.subscribe("sms");
console.log('Start to listen `sms` queue...');

License

MIT