panfen / wemovie Goto Github PK
View Code? Open in Web Editor NEW利用nodejs搭建的微信公众号用于展示从网页爬取的电影资讯
利用nodejs搭建的微信公众号用于展示从网页爬取的电影资讯
封装好的xml模板能正常输出图文消息和文本消息。但是当我调用素材接口成功后把mediaId作为图片消息XML模板的ID返回给微信服务器之后,微信客户端报错:“该微信公众号提供的服务有错...”。
打印发现输出的XML模板符合官网的结构。
我想请问下,你知不知道这个视频里讲的QQ浏览器服务端本地调试怎么开启啊?
我的公众号是新的公众号,没有配置菜单
当发送文字消息给公众号时,node服务端报错如下:
Error: get menu failed! at E:\hbuilder_workspace\wemovie\wechat\wechat.js:244:12 at tryCatcher (E:\hbuilder_workspace\wemovie\node_modules\bluebird\js\rele ase\util.js:16:23) at Promise._settlePromiseFromHandler (E:\hbuilder_workspace\wemovie\node_m odules\bluebird\js\release\promise.js:512:31) at Promise._settlePromise (E:\hbuilder_workspace\wemovie\node_modules\bluebird\js\r elease\promise.js:569:18) at Promise._settlePromise0 (E:\hbuilder_workspace\wemovie\node_modules\bluebird\js\ release\promise.js:614:10) at Promise._settlePromises (E:\hbuilder_workspace\wemovie\node_modules\bluebird\js\ release\promise.js:693:18) at Promise._fulfill (E:\hbuilder_workspace\wemovie\node_modules\bluebird\js\release \promise.js:638:18) at Request._callback (E:\hbuilder_workspace\wemovie\node_modules\bluebird\js\releas e\nodeback.js:42:21) at Request.self.callback (E:\hbuilder_workspace\wemovie\node_modules\request\reques t.js:188:22) at emitTwo (events.js:126:13) at Request.emit (events.js:214:7) at Request.<anonymous> (E:\hbuilder_workspace\wemovie\node_modules\request\request. js:1171:10) at emitOne (events.js:116:13) at Request.emit (events.js:211:7) at IncomingMessage.<anonymous> (E:\hbuilder_workspace\wemovie\node_modules\request\ request.js:1091:12) at Object.onceWrapper (events.js:313:30)
yield handler.call(this,next); //转到外层逻辑
wechat.replay.call(this); //真正回复
handler是一个generator里面一个函数的第二个参数,这个函数在app.js里面被调用,然后app.js里面传的是wechat.replay 这个函数,那这样写是不是重复 了呢?你觉得呢?只需要这一句代码就够了吧? yield handler.call(this,next); 这个代码的作用就是让this对象继承wechat.reply方法.你觉得呢?
Listening 80...
oFYSY1BaQHaE2BBWeJFW59EeZbcE 悄悄地走了...
TypeError: Cannot read property 'then' of undefined
at /home/git/weixin_djss/wechat/wechat.js:237:26
at Promise._execute (/home/git/weixin_djss/node_modules/bluebird/js/release/debuggability.js:313:9)
at Promise._resolveFromExecutor (/home/git/weixin_djss/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/home/git/weixin_djss/node_modules/bluebird/js/release/promise.js:79:10)
at Wechat.getMenu (/home/git/weixin_djss/wechat/wechat.js:236:9)
at Object.exports.setMenu (/home/git/weixin_djss/weixin.js:158:33)
at next (native)
at onFulfilled (/home/git/weixin_djss/node_modules/co/index.js:65:19)
at /home/git/weixin_djss/node_modules/co/index.js:54:5
at Object.co (/home/git/weixin_djss/node_modules/co/index.js:50:10)
at Object.toPromise (/home/git/weixin_djss/node_modules/co/index.js:118:63)
at next (/home/git/weixin_djss/node_modules/co/index.js:99:29)
at onFulfilled (/home/git/weixin_djss/node_modules/co/index.js:69:7)
at /home/git/weixin_djss/node_modules/co/index.js:54:5
at Object.co (/home/git/weixin_djss/node_modules/co/index.js:50:10)
at Object.toPromise (/home/git/weixin_djss/node_modules/co/index.js:118:63)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.