Node.js module for Adobe Behance Portfolio development API's
Behace is an online portfolios website. Here an user can create and watch his portfolios. node-behance-api is an utility wrapper for Adobe Behance rest services for node.js. This utility is developed for node.js only. Currently it supports all of the API's of Adobe Behance. You can update and add other api by simple coding.
Before starting development on node. You have to register your app on https://www.behance.net/dev/register. Register your app and get the client id from there.
*This utility wrapper uses request module.
Installation
$ npm install node-behance-api
Requirement
request - npm https://www.npmjs.org/package/request
examples:
var Behance = require("node-behance-api");
var behance = new Behance({"client_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"})
Behance.initOptions();
behance.get(Behance.APIS.GET_USER, {
user:'deepakmshrma'
}, function (error, result) {
if (error)
console.log(error)
else
console.log(result)
})
integration of another api's node-behance-api
var Behance = require("node-behance-api");
var behance = new Behance({"client_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"})
Behance.initOptions({
postProcess: function (options) {
var newapis = {
"users": {
"name": "users",
"url": "users",
"params": {
"client_id": true,
"q": false,
"sort": false,
"time": false,
"field": false,
"country": false,
"state": false,
"city": false,
"page": false,
"tags": false,
"color_hex": false,
"color_range": false
}
}
}
options = extend(true, {}, newapis, options);
return options;
}
});
behance.get({
api: Behance.APIS.GET_USER,
params: {
user: 'deepakmshrma'
}
}, function (error, result) {
if (error)
console.log(error)
else
console.log(result)
});
var behance = new Behance({"client_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"})
Behance.initOptions();
behance.get(Behance.APIS.GET_USER, {
user:'deepakmshrma'
}, function (error, result) {
if (error)
console.log(error)
else
console.log(result)
})
integration of another api's node-behance-api
var behance = new Behance({"client_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"})
Behance.initOptions({
postProcess: function (options) {
var newapis = {
"users": {
"name": "users",
"url": "users",
"params": {
"client_id": true,
"q": false,
"sort": false,
"time": false,
"field": false,
"country": false,
"state": false,
"city": false,
"page": false,
"tags": false,
"color_hex": false,
"color_range": false
}
}
}
options = extend(true, {}, newapis, options);
return options;
}
});
behance.get({
api: Behance.APIS.GET_USER,
params: {
user: 'deepakmshrma'
}
}, function (error, result) {
if (error)
console.log(error)
else
console.log(result)
});
Comments
Post a Comment