This project provide a node api for lutim.
The source code is strongly inspired by node-imgur
npm install lutim
var lutim = require('lutim');
By default node-lutim url will be https://framapic.org/. You can change it using setApiUrl(url)
.
lutim.setApiUrl(lutimUrl);
Getter for the current api url.
Returns a String
lutim.getApiUrl() // => 'http://myUrl/'
See https://framagit.org/fiat-tux/hat-softwares/lutim/wikis/API#get-informations-about-the-server
Returns a Promise
lutim.getServerInfos()
.then(function (res) {
// Handle res
})
.catch(function (err) {
// Handle err
})
uploadImage(filePath: String, deleteDay?: number, firstView?: number, keepExif?: number, crypt?: number): Promise
See https://framagit.org/fiat-tux/hat-softwares/lutim/wikis/API#add-images
Returns a Promise
lutim.uploadImage(filePath)
.then(function (res) {
// Handle res
})
.catch(function (err) {
// Handle err
})
lutim.uploadImage(filePath, deleteDay, firstView, keepExif, crypt)
.then(function (res) {
// Handle res
})
.catch(function (err) {
// Handle err
})
See https://framagit.org/fiat-tux/hat-softwares/lutim/wikis/API#delete-images
Returns a Promise
lutim.deleteImage(realShort, token)
.then(function (res) {
// Handle res
})
.catch(function (err) {
// Handle err
})
See https://framagit.org/fiat-tux/hat-softwares/lutim/wikis/API#modify-images
Returns a Promise
lutim.modifyImage(realShort, token, deleteDay)
.then(function (res) {
// Handle res
})
.catch(function (err) {
// Handle err
})
lutim.modifyImage(realShort, token, deleteDay, firstView)
.then(function (res) {
// Handle res
})
.catch(function (err) {
// Handle err
})
See https://framagit.org/fiat-tux/hat-softwares/lutim/wikis/API#get-images
Returns a Promise
lutim.getImage(short)
.then(function (res) {
// Handle res
})
.catch(function (err) {
// Handle err
})
See https://framagit.org/fiat-tux/hat-softwares/lutim/wikis/API#get-informations-about-an-image
Returns a Promise
lutim.getImageInfos(realShort)
.then(function (res) {
// Handle res
})
.catch(function (err) {
// Handle err
})
See https://framagit.org/fiat-tux/hat-softwares/lutim/wikis/API#get-counter-and-status-of-image
Returns a Promise
lutim.getImageCountAndStatus(short, token)
.then(function (res) {
// Handle res
})
.catch(function (err) {
// Handle err
})
The code is inspired by node-imgur
Made for lutim