Last active
August 12, 2019 09:50
-
-
Save devdarren7/63bc5d916f62969b63500f3c669c1066 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /** | |
| * ./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