UNPKG

isv-http

Version:

a simple http for isv-gallery-kissy

27 lines (23 loc) 879 B
var request = require('request'); exports.getCompileCajoledCode = function (content, name, cb) { request.post("http://zxn.taobao.com/tbcajaService.htm", {form: { token: 'TAE-SDK', content: content, component: name }}, function (error, response, body) { if (!error && response.statusCode == 200) { body = body.substring(body.indexOf('TShop')); body = body.replace(/&#39;/g, "'"); body = body.replace(/&quot;/g, '"'); body = body.replace(/&amp;/g, '&'); body = body.replace(/&lt;/g, '<'); body = body.replace(/&gt;/g, '>'); body = body.replace(/\\\\\"/g, "\\\""); if (cb) { cb(body); } } } ); };