Hitokoto Node.js version
<script type="text/javascript" src="/hitokoto?callback=setHitokoto"></script>
setTimeout(function() {
var scr = document.createElement('script');
scr.setAttribute('src','/hitokoto?callback=setHitokoto');
document.body.appendChild(scr);
},100);
function setHitokoto(res) {
// do something...
}
- copy
module
into your project folder - insert
var hitokoto = require('./modules/hitokoto');
into your code hitokoto.getData(function(data) { // do something... });
- Done.
setBlockedWords(array); // Array params
var data = {
id : "123456789",
content : "赠人玫瑰,手有余香;还人玫瑰,手有余伤。",
source : "ShinCurry"
}
Hitokoto Node.js version
<script type="text/javascript" src="/hitokoto?callback=setHitokoto"></script>
setTimeout(function() {
var scr = document.createElement('script');
scr.setAttribute('src','/hitokoto?callback=setHitokoto');
document.body.appendChild(scr);
},100);
function setHitokoto(res) {
// do something...
}
- 拷贝
module
文件夹到你自己的项目目录 - 导入 Module
var hitokoto = require('./modules/hitokoto');
- 调用
hitokoto.getData(function(data) { // do something... });
setBlockedWords(array); // 传入一个数组
var data = {
id : "123456789",
content : "赠人玫瑰,手有余香;还人玫瑰,手有余伤。",
source : "ShinCurry"
}