3 Star 0 Fork 0

Gitee 极速下载 / pinclub

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/pinclub/pinclub.git
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Pinclub

node version build status coverage report Code Climate Gitter

介绍 / Intro

Pinclub 是基于 Nodeclub 进行的二次开发. 增加了瀑布流展示方式, 主要参考花瓣网的设计风格(感谢花瓣网的设计师和前端工程师的辛勤工作), 加入了hanming距离的算法, 当然是在mongodb中使用了 function 的形式实现.

Pinclub's base code is forked from Nodeclub project. Pinclub add waterfall layout using Masonry plugin. The style of Frontend is mainly refer to Huaban.com, thanks. For support simulate search function simply add an mongodb function to achieve the Hamming Distance algorithm.

状态 / Status

Pinclub 目前处于开发阶段,尚未发布 Stable 版本.

Pinclub is at developing statge, not stable enough.

图片相似度算法说明 / About HammingDistance

在 Topic 模型中加入了 image 的相关属性值, 其中就包括 image_hash, 使用 imghash 模块生成了 16 bits 的二进制字符串.

在 Mongodb 中创建了一个 function 命名为 hammingDistance, 代码如下:

At the Topic modal, we add a property named image_hash, to save the image hash of pictures, and we build a function in Mongodb, blow is the code segment of it:

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;
}

通过 mongo 命令行创建 Function

创建脚本:

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 插件获取外部图片 / Chrome plugin to Get picture

如果目标网站做了引用保护,则无法完成图片的 Get 操作

插件下载地址 / Download Chrome plugin

插件应用商店地址 / Download Chrome plugin from web store

插件项目地址 / Plugin Project

TODO / How to Contribute

如果你想贡献一份力量, 请查看 TODO 列表

安装部署

不保证 Windows 系统的兼容性

线上跑的是 Node.js v4.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接口文档

使用 npm run apidoc 命令在本地生成文档后, 访问: http://localhost:3000/public/apidoc

截图

首页 上传图片 设置board 图片box Get图片 Dashboard 用户列表 板块列表 板块弹出模态框

关于 Nodeclub

Nodeclub 是使用 Node.jsMongoDB 开发的社区系统,界面优雅,功能丰富,小巧迅速, 已在Node.js 中文技术社区 CNode(http://cnodejs.org) 得到应用,但你完全可以用它搭建自己的社区。

测试(完善中)

跑测试

$ make test

跑覆盖率测试

$ make test-cov

贡献

Pinclub 可以联系 @hhdem

Nodeclub 有任何意见或建议都欢迎提 issue,或者直接提给 @alsotang

License

Pinclub is released under the MIT License. Have at it.

(The MIT License) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
JavaScript 等 5 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/mirrors/pinclub.git
git@gitee.com:mirrors/pinclub.git
mirrors
pinclub
pinclub
master

搜索帮助