Giter Club home page Giter Club logo

pinclub's Introduction

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.

pinclub's People

Contributors

alsotang avatar fengmk2 avatar hhdem avatar greenkeeperio-bot avatar tiye avatar jacksontian avatar dead-horse avatar huacnlee avatar leizongmin avatar takwolf avatar strwind avatar vfasky avatar kennyz avatar muyuan avatar yorkie avatar young40 avatar vuekit avatar ricardo-li avatar lanceli avatar ravenwang avatar aisk avatar hylin avatar ericzhang-cn avatar davidcai1111 avatar jysperm avatar matrixbirds avatar xgheaven avatar jsonshen avatar magicdawn avatar nosqldb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.