日韩亚洲欧美一区二区三区,日本免费暖暖在线小视频,翘臀美女131,国产午夜av一在线观看

NODE.JS

NODE.JS代碼示例

/* *
 * 接口類型:達(dá)信通觸發(fā)短信接口,支持發(fā)送驗(yàn)證碼短信、訂單通知短信等。
 * 賬戶注冊(cè):請(qǐng)通過該地址開通賬戶http://sms.wx96.com/register.html
 * 注意事項(xiàng):
*(1)調(diào)試期間,請(qǐng)用默認(rèn)的模板進(jìn)行測(cè)試,默認(rèn)模板詳見接口文檔;
 *(2)請(qǐng)使用 用戶名 及 APIkey來調(diào)用接口,APIkey在會(huì)員中心可以獲??;
*(3)該代碼僅供接入達(dá)信通短信接口參考使用,客戶可根據(jù)實(shí)際需要自行編寫;
*/
 
/**
 * Created by XadillaX on 14-2-12.
 * https://github.com/XadillaX/wx96106js
*/ String.prototype.replaceAll = function(reallyDo, replaceWith, ignoreCase) { if (!RegExp.prototype.isPrototypeOf(reallyDo)) { return this.replace(new RegExp(reallyDo, (ignoreCase ? "gi": "g")), replaceWith); } else { return this.replace(reallyDo, replaceWith); } }; var dom = require('xmldom').DOMParser; var _baseUri = "http://106.wx96.com/webservice/sms.php?method=Submit";
var _userAgent = "node-wx96106-module by 死月 (admin@xcoder.in)";
/** * wx96 constructure.
* @param account * @param password 查看密碼請(qǐng)登錄用戶中心->驗(yàn)證碼、通知短信->帳戶及簽名設(shè)置->APIKEY */ var wx96 = function(account, password) {
this.spidex = require("spidex"); this.spidex.setDefaultUserAgent(_userAgent); this.account = account; this.password = password; }; /** * send an SMS. * @param mobile * @param content * @param callback */ wx96.prototype.send = function(mobile, content, callback) { var data = { account : this.account, password : this.password, mobile : mobile, content : content }; this.spidex.post(_baseUri, function(html, status) { if(status !== 200) { callback(new Error("短信發(fā)送服務(wù)器響應(yīng)失敗。")); return; } html = html.replaceAll("\r", ""); html = html.replaceAll("\n", ""); html = html.replaceAll(" xmlns=\"http://106.wx96.com/\"", "");
//console.log(html); var doc = new dom().parseFromString(html); var result = doc.lastChild; var json = {}; for(var node = result.firstChild; node !== null; node = node.nextSibling) { json[node.tagName] = node.firstChild.data; } //console.log(json); if(json.code == "2") { callback(null, json.smsid); } else { callback(new Error(json.msg, parseInt(json.code))); } }, data, "utf8").on("err", function(e) { callback(e); }); }; module.exports = wx96;
在線咨詢
電話咨詢

服務(wù)熱線:

4008 808 898

服務(wù)熱線(工作時(shí)間):

4008 808 898

業(yè)務(wù)咨詢(非工作時(shí)間):

4008 808 898

售后咨詢(非工作時(shí)間):

4008 808 898

海林市| 海丰县| 高雄县| 城市| 山东省| 柳林县| 鄢陵县| 临西县| 辽宁省| 静安区| 上杭县| 永康市| 调兵山市| 福清市| 农安县| 汉川市| 隆德县| 江油市| 九龙坡区| 壤塘县| 广丰县| 那曲县| 尉氏县| 榆林市| 阜新市| 大石桥市| 灵璧县| 应城市| 瑞金市| 湖州市| 鹰潭市| 太原市| 凌海市| 山丹县| 西藏| 合阳县| 安龙县| 佛冈县| 西贡区| 彰化市| 沅江市|