Skip to content

Instantly share code, notes, and snippets.

@devdarren7
Last active August 12, 2019 09:50
Show Gist options
  • Select an option

  • Save devdarren7/63bc5d916f62969b63500f3c669c1066 to your computer and use it in GitHub Desktop.

Select an option

Save devdarren7/63bc5d916f62969b63500f3c669c1066 to your computer and use it in GitHub Desktop.
/**
* ./routes/api.js
* This is where you'll set up any REST api endpoints you plan on using.
*/
const express = require('express');
const router = express.Router();
router.get('/', (req, res, next) => {
var xmlrpc = require('xmlrpc')
var params = {
'username' : 'MG**',
'password' : 've***',
'provider_key' : ******',
'lcode' : '******',
}
var wubook = {};
const request = `
<?xml version="1.0"?><methodCall>
<methodName>acquire_token</methodName>
<params>
<param>
<value>
<string>MG329</string>
</value>
</param>
<param>
<value>
<string>velo173o</string>
</value>
</param>
<param>
<value>
<string>9cfc231abfdc3b5d372e9f28055cdef10fea05cd3e178b98</string>
</value>
</param>
</params>
</methodCall>`;
wubook.acquire_token = function (domain, callback) {
var client = xmlrpc.createClient({
host: "https://wubook.net",
path: "/xrwx"
});
client.methodCall('acquire_token', [request], ( value) => {
console.log(value);
});
};
return wubook.acquire_token.value
});
module.exports = router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment