1.1.2 • Published 6 years ago
ofo v1.1.2
ofo
free bike for everyone
Installation
$ npm i ofo
Example
const ofo = require('ofo');
(async () => {
const location = { lat: 48.85, lng: 2.37 };
let token = await waitForInput('Do you have user token ? ');
if(!token){
const ccc = await waitForInput('What\'s your country code ? ');
const mobile = await waitForInput('What\'s your mobile phone number ? ');
const result = await ofo.code(mobile, { ccc });
console.log('sms code sent:', result);
const code = await waitForInput('please input OTP code:> ');
({ token } = await ofo.login(mobile, code, location));
console.log('user token:', token);
}
const bikes = await ofo.near(token, location);
console.log('near bikes', bikes);
})();
~$ node example
Do you have user token ?
What's your country code ? 86
What's your mobile phone number ? 18510100102
sms code sent: {}
please input OTP code:> 1866
user token: efdef560-9fba-11e8-8cc1-ed96632744a7
near bikes { cars:
[ { carno: 'gEgdNq',
bomNum: '3DA',
userIdLast: '1',
lng: 2.3686030741643,
lat: 48.850329008564 },
{ carno: 'k8GZMD',
bomNum: '5CA',
userIdLast: '1',
lng: 2.3710391418327,
lat: 48.848762424329 },
{ carno: 'KrVLj8',
bomNum: '0',
userIdLast: '1',
lng: 2.3698150921119,
lat: 48.851634707216 },
{ carno: 'M28ABb',
bomNum: '5CA',
userIdLast: '1',
lng: 2.3724473707886,
lat: 48.849355266049 },
{ carno: 'beWLYW',
bomNum: '5CA',
userIdLast: '1',
lng: 2.3678884837909,
lat: 48.848553602448 },
{ carno: 'DgB4GQ',
bomNum: '5CA',
userIdLast: '1',
lng: 2.3722501962554,
lat: 48.851332147867 },
{ carno: 'OMgjj0',
bomNum: '5CA',
userIdLast: '1',
lng: 2.3723723037124,
lat: 48.851329221407 },
{ carno: 'n81qQ6',
bomNum: '3DA',
userIdLast: '1',
lng: 2.36647032962,
lat: 48.850227811611 },
{ carno: '383bBW',
bomNum: '5CA',
userIdLast: '1',
lng: 2.3663582391625,
lat: 48.850997750058 },
{ carno: 'ARaAlr',
bomNum: '2OA',
userIdLast: '1',
lng: 2.3730018620364,
lat: 48.848183601453 },
{ carno: 'WEeax3',
bomNum: '5CA',
userIdLast: '1',
lng: 2.369863135327,
lat: 48.847212733796 },
{ carno: 'j8gdPY',
bomNum: '0',
userIdLast: '1',
lng: 2.374418795753,
lat: 48.849158446653 },
{ carno: '6lO5jK',
bomNum: '5CA',
userIdLast: '1',
lng: 2.3738646313409,
lat: 48.851835130001 },
{ carno: '2l9A5n',
bomNum: '2OA',
userIdLast: '1',
lng: 2.3739737293869,
lat: 48.852003197158 },
{ carno: 'm9qdDA',
bomNum: '5CA',
userIdLast: '1',
lng: 2.371883877277,
lat: 48.846629926471 } ],
expPrice:
{ price: '0.50',
actualPrice: '0.50',
orderTime: 1200,
currency: '€',
type: 1 },
icon:
'http://ofo-testmeixi-image.oss-us-west-1.aliyuncs.com//report/6fc78646df3a375416f9c1884728fa50.png',
bikeIcon:
[ { bomNum: '0',
icon:
'http://ofo-testmeixi-image.oss-us-west-1.aliyuncs.com//report/6fc78646df3a375416f9c1884728fa50.png',
animationUrl: '' } ] }
Contributing
- Fork this Repo first
- Clone your Repo
- Install dependencies by
$ npm install
- Checkout a feature branch
- Feel free to add your features
- Make sure your features are fully tested
- Publish your local branch, Open a pull request
- Enjoy hacking <3
MIT
This work is licensed under the MIT license.