Ricky123
V2EX  ›  Evernote

有人用过 Evernote 的 Nodejs sdk 吗? 求 getResourceByHash 的正确用法

  •  
  •   Ricky123 · Mar 12, 2015 · 2634 views
    This topic created in 4247 days ago, the information mentioned may be changed or developed.

    RT
    在用evernote的node sdk做一些工具
    现在已经能读到授权用户的笔记内容了
    可是图片表示是<en-media>的一个hash值

    按reference的说法是 要把这个hash值转化为binary才能调用getResourceByHash

    于是我用了这个方法

    function hex2bin(hex){
        var bytes = [];
        for(var i=0; i< hex.length-1; i+=2) {
            bytes.push(parseInt(hex.substr(i, 2), 16));
        }
        return String.fromCharCode.apply(String, bytes);    
    }
    

    可是结果并不成功啊

    在stackoverflow上也问了这个问题,可是那位大叔解决方案也不对啊。。。

    求各位用过evernote node sdk的人给与帮助

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1642 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 19ms · UTC 17:32 · PVG 01:32 · LAX 10:32 · JFK 13:32
    ♥ Do have faith in what you're doing.