oemsys 发表于 2019-4-21 19:38:05

『Node-RED』对接!@百度翻译!

『Node-RED』百度翻译!

直接上效果!@哈哈!@!@!@


先去百度翻译申请:http://api.fanyi.baidu.com/api/trans/product/prodinfo#0


记录:APPID 密码


导入流程:
[{"id":"26201c99.959cf4","type":"tab","label":"流程7","disabled":false,"info":""},{"id":"34e785b6.e3573a","type":"function","z":"26201c99.959cf4","name":"百度参数设置","func":"//须要翻译的内内容\nmsg.q = '苹果'\n//百度密钥\nvar key = '密钥'\n//APP ID\nmsg.appid = 'APP ID'\nmsg.salt = Math.floor(Math.random()*100000000);\nmsg.sign = msg.appid + msg.q + msg.salt + key\n\nreturn msg;","outputs":1,"noerr":0,"x":700,"y":40,"wires":[["8fe11038.9ff04"]]},{"id":"8fe11038.9ff04","type":"md5","z":"26201c99.959cf4","name":"","fieldToHash":"sign","fieldTypeToHash":"msg","hashField":"sign","hashFieldType":"msg","x":850,"y":40,"wires":[["6bb7b7cc.8f8ca8"]]},{"id":"6bb7b7cc.8f8ca8","type":"function","z":"26201c99.959cf4","name":"参数","func":"msg.headers={\n    'Content-Type':'application/x-www-form-urlencoded;',\n};\n\nmsg.url = 'http://api.fanyi.baidu.com/api/trans/vip/translate?q='+encodeURI(msg.q)+'&from=auto&to=auto&appid='+msg.appid+'&salt='+msg.salt+'&sign='+msg.sign\nreturn msg;","outputs":1,"noerr":0,"x":970,"y":40,"wires":[["455339f1.887f58"]]},{"id":"455339f1.887f58","type":"http request","z":"26201c99.959cf4","name":"","method":"POST","ret":"obj","paytoqs":false,"url":"","tls":"","proxy":"","authType":"basic","x":1100,"y":40,"wires":[["100ea2ea.01a44d"]]},{"id":"100ea2ea.01a44d","type":"debug","z":"26201c99.959cf4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1250,"y":40,"wires":[]},{"id":"3c9f156.0402aea","type":"inject","z":"26201c99.959cf4","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":490,"y":40,"wires":[["34e785b6.e3573a"]]}]

填写 APPID 密码设置要翻译内容!


运行测试!@!@!@!@




哈哈!@!@!@!OK了!@!@!@!@坚决不做申手党!@!@!@




peter5858 发表于 2019-4-21 20:01:02

谢谢分享学习中

nuaawmy 发表于 2019-4-21 22:30:13

对接微信传递信息咋弄

发表于 2019-4-21 22:39:54

我就想知道微信机器人怎么弄的:lol:lol

hellerx 发表于 2019-4-21 22:50:35

Jones 发表于 2019-4-21 22:39
我就想知道微信机器人怎么弄的

nodered有人专门做了微信的插件

star_liu 发表于 2019-4-22 00:02:48

hellerx 发表于 2019-4-21 22:50
nodered有人专门做了微信的插件

求关键词

oemsys 发表于 2019-4-22 06:27:39

Jones 发表于 2019-4-21 22:39
我就想知道微信机器人怎么弄的

mojo weixin

oemsys 发表于 2019-4-22 06:28:51

Jones 发表于 2019-4-21 22:39
我就想知道微信机器人怎么弄的

https://github.com/sjdy521/Mojo-Weixin

lmy8812 发表于 2019-4-22 11:44:07

我也只关心微信:D

pigcais 发表于 2019-4-22 14:03:00

oemsys 发表于 2019-4-22 06:28
https://github.com/sjdy521/Mojo-Weixin

微信机器人是个好东西
页: [1] 2
查看完整版本: 『Node-RED』对接!@百度翻译!