EPFL People API.
npm i epfl-people-api --save
const epflPeopleApi = require('epfl-people-api');
epflPeopleApi.findBySciper(128871, 'en').then(function(person) {
console.log(person.name); //=> 'Duratti'
console.log(person.firstname); //=> 'Lindo'
console.log(person.office); //=> 'INN 018'
console.log(person.position); //=> 'Computer Scientist'
}).catch(function(err) {
console.log(err);
});
epflPeopleApi.findByEmail('lindo.duratti@epfl.ch', 'en').then(function(person) {
console.log(person.firstname); //=> 'Lindo'
console.log(person.sciper); //=> '128871'
console.log(person.phones); //=> '+41 21 6934553'
console.log(person.unit); //=> 'EXAPP'
}).catch(function(err) {
console.log(err);
});
epflPeopleApi.find('Oryshchuk', 'en').then(function(list) {
console.log(list[0].firstname); //=> 'Anastasiia'
}).catch(function(err) {
console.log(err);
});
epflPeopleApi.hasPhoto(128871).then(function(hasPhoto) {
console.log(hasPhoto); //=> False
}).catch(function(err) {
console.log(err);
});
epflPeopleApi.getPhotoUrl(278890).then(function(url) {
console.log(url); //=> https://people.epfl.ch/private/common/photos/links/278890.jpg
}).catch(function(err) {
console.log(err);
});
Type: function
Returns a Promise with a person as parameter.
Type: number
6-digit unique EPFL identification number.
Type: string
Default: en
Supported locales are English (en
) and French (fr
).
Type: function
Returns a Promise with a person as parameter.
Type: string
A valid email address.
Type: string
Default: en
Supported locales are English (en
) and French (fr
).
Type: function
Returns a Promise with a list of person as parameter.
Type: string
The term to look for.
Type: string
Default: en
Supported locales are English (en
) and French (fr
).
Type: function
Returns a Promise with a boolean as parameter.
Type: number
6-digit unique EPFL identification number.
Type: function
Returns a Promise with a string as parameter.
Type: number
6-digit unique EPFL identification number.
Contributions are always welcome.
See Contributing.
Apache License 2.0
Original work (c) ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, VPSI, 2017-2018.
Modified work (c) William Belle, 2018-2020.
See the LICENSE file for more details.