projekodun v1.1.4
ProjeKodun API
ProjeKodun API, has been developed so that you can use ProjeKodun in your own projects.
getCode() function
With this function, you can access the codes in your ProjeKodun account.
Example Usage
const pk = require("projekodun");
const token = "PROJEKODUN APP TOKEN";
pk.getCode(token, "CODE ID", function(data){
console.log(data);
});
deleteCode() function
With this function, you can delete the codes in your ProjectKodun account.
Example Usage
const pk = require("projekodun");
const token = "PROJEKODUN APP TOKEN";
pk.deleteCode(token, "CODE ID", function(data){
console.log(data);
});
likeCode() function
With this function, you can like the codes in ProjeKodun.
Note: The like process takes place in the user's account of the application token.
Example Usage
const pk = require("projekodun");
const token = "PROJEKODUN APP TOKEN";
pk.likeCode(token, "CODE ID", function(data){
console.log(data);
});
getInf() function
With this function, you can access the infrastructure in your ProjeKodun account.
Example Usage
const pk = require("projekodun");
const token = "PROJEKODUN APP TOKEN";
pk.getInf(token, "CODE ID", function(data){
console.log(data);
});
deleteInf() function
With this function, you can delete the infrastructure in your ProjectKodun account.
Example Usage
const pk = require("projekodun");
const token = "PROJEKODUN APP TOKEN";
pk.deleteInf(token, "CODE ID", function(data){
console.log(data);
});
likeInf() function
With this function, you can like the infrastructure in ProjeKodun.
Note: The like process takes place in the user's account of the application token.
Example Usage
const pk = require("projekodun");
const token = "PROJEKODUN APP TOKEN";
pk.likeInf(token, "CODE ID", function(data){
console.log(data);
});
loginSystem() function
It allows you to add the entry system of ProjeKodun to your website.
Example Usage
const express = require("express");
const app = express();
const expressSession = require("express-session");
const projekodun = require("projekodun");
var token = "PROJEKODUN APP TOKEN", secret = "PROJEKODUN APP SECRET";
app.use(expressSession({
secret: "secret",
resave: false,
saveUninitialized: true
}));
app.get("/login", (req,res)=>{
if(!req.query.authid){
res.redirect("https://projekodun.org/api/authorize/"+secret);
}else{
projekodun.loginSystem(token, secret, req.query.authid, function(err, user){
if(err) return res.send("Hata!");
req.session.username = user.username;
res.redirect("/");
});
};
});
app.listen(3000);
It will return 3 data from the user: username, e-mail and avatar.
ProjeKodun CLI
For this, you need to install Projekodun globally.
npm install -g projekodun
You can see the options by typing pk help
.