Pinclub 介绍
@H_502_0@
加入了hanming距离的算法, 当然是在mongodb中使用了 function 的形式实现.
的二进制字符串. @H_502_0@在 Mongodb 中创建了一个 function 命名为 hammingdistance, 代码如下:
plugin @H_502_0@插件应用商店地址 / Download Chrome plugin from web
store @H_502_0@插件项目地址 / Plugin Project
列表
v4.4.0,MongoDB 是 v3.0.5,Redis
是 v3.0.3。
开发的社区系统,界面优雅,功能丰富,小巧迅速, 已在Node.js 中文技术社区
CNode(http://cnodejs.org) 得到应用,但你完全可以用它搭建自己的社区。
介绍
@H_502_0@Pinclub 是基于 Nodeclub 进行的二次开发. 增加了瀑布流展示方式, 主要参考花瓣网的设计风格(感谢花瓣网的设计师和前端工程师的辛勤工作),加入了hanming距离的算法, 当然是在mongodb中使用了 function 的形式实现.
状态
@H_502_0@Pinclub 目前处于开发阶段,尚未发布 Stable 版本.图片相似度算法说明
@H_502_0@在 Topic 模型中加入了 image 的相关属性值, 其中就包括 image_hash, 使用 imghash 模块生成了 16 bits的二进制字符串. @H_502_0@在 Mongodb 中创建了一个 function 命名为 hammingdistance, 代码如下:
function (a, b) { if (typeof(a) === "undefined" || typeof(b) === "undefined") return 64; var aa = a.split(""); var bb = b.split(""); var count = 0; for (var i = 0; i < aa.length; i++) if (aa[i] !== bb[i]) count++; return count; }@H_502_0@通过 mongo 命令行创建 Function @H_502_0@创建脚本:
db.system.js.save( { _id: "hammingdistance", value : function (a, b) { if (typeof(a) === "undefined" || typeof(b) === "undefined") return 64; var aa = a.split(""); var bb = b.split(""); var count = 0; for (var i = 0; i < aa.length; i++) if (aa[i] !== bb[i]) count++; return count; } } )
Chrome 插件获取外部图片
@H_502_0@如果目标网站做了引用保护,则无法完成图片的 Get 操作 @H_502_0@插件下载地址 / Download Chromeplugin @H_502_0@插件应用商店地址 / Download Chrome plugin from web
store @H_502_0@插件项目地址 / Plugin Project
Todo / How to Contribute
@H_502_0@如果你想贡献一份力量, 请查看 TODO列表
安装部署
@H_502_0@不保证 Windows 系统的兼容性 @H_502_0@线上跑的是 Node.jsv4.4.0,MongoDB 是 v3.0.5,Redis
是 v3.0.3。
1. 安装 `Node.js[必须]` `MongoDB[必须]` `Redis[必须]` 2. 启动 MongoDB 和 Redis 3. `$ make install` 安装 Nodeclub 的依赖包 4. `cp config.default.js config.js` 请根据需要修改配置文件 5. `$ make test` 确保各项服务都正常 6. `$ node app.js` 7. visit `http://localhost:3000` 8. done!
API接口文档
@H_502_0@使用 npm run apidoc 命令在本地生成文档后, 访问: http://localhost:3000/public/apidoc截图
@H_502_0@关于 Nodeclub
@H_502_0@Nodeclub 是使用 Node.js 和 MongoDB开发的社区系统,界面优雅,功能丰富,小巧迅速, 已在Node.js 中文技术社区
CNode(http://cnodejs.org) 得到应用,但你完全可以用它搭建自己的社区。
测试(完善中)
@H_502_0@跑测试$ make test@H_502_0@跑覆盖率测试
$ make test-cov