<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Pinclub社區(qū)系統(tǒng) Nodeclub? 的二次開發(fā)

          聯(lián)合創(chuàng)作 · 2023-10-02 10:51

          介紹

          Pinclub 是基于 Nodeclub 進行的二次開發(fā). 增加了瀑布流展示方式, 主要參考花瓣網(wǎng)的設(shè)計風格(感謝花瓣網(wǎng)的設(shè)計師和前端工程師的辛勤工作), 加入了hanming距離的算法, 當然是在mongodb中使用了 function 的形式實現(xiàn).

          狀態(tài)

          Pinclub 目前處于開發(fā)階段,尚未發(fā)布 Stable 版本.

          圖片相似度算法說明

          在 Topic 模型中加入了 image 的相關(guān)屬性值, 其中就包括 image_hash, 使用 imghash 模塊生成了 16 bits 的二進制字符串.

          在 Mongodb 中創(chuàng)建了一個 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;
          }

          通過 mongo 命令行創(chuàng)建 Function

          創(chuàng)建腳本:

          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 插件獲取外部圖片

          如果目標網(wǎng)站做了引用保護,則無法完成圖片的 Get 操作

          插件下載地址 / Download Chrome plugin

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

          插件項目地址 / Plugin Project

          TODO / How to Contribute

          如果你想貢獻一份力量, 請查看 TODO 列表

          安裝部署

          不保證 Windows 系統(tǒng)的兼容性

          線上跑的是 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` 請根據(jù)需要修改配置文件
          5. `$ make test` 確保各項服務都正常
          6. `$ node app.js`
          7. visit `http://localhost:3000`
          8. done!

          API接口文檔

          使用 npm run apidoc 命令在本地生成文檔后, 訪問: http://localhost:3000/public/apidoc

          截圖

          首頁上傳圖片設(shè)置board圖片box Get圖片

          關(guān)于 Nodeclub

          Nodeclub 是使用 Node.js 和 MongoDB 開發(fā)的社區(qū)系統(tǒng),界面優(yōu)雅,功能豐富,小巧迅速, 已在Node.js 中文技術(shù)社區(qū) CNode(http://cnodejs.org) 得到應用,但你完全可以用它搭建自己的社區(qū)。

          測試(完善中)

          跑測試

          $ make test

          跑覆蓋率測試

          $ make test-cov

          貢獻

          Pinclub 可以聯(lián)系 @hhdem

          Nodeclub 有任何意見或建議都歡迎提 issue,或者直接提給 @alsotang

          License

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

          瀏覽 20
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  暴操无码| 91久久精品人人槡人妻人 | 国产v亚洲v日韩v欧美v天堂V | 欧美特级黄片在线播放 | 肏屄网|