Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_46011646
wechaty
提交
6283434b
W
wechaty
项目概览
weixin_46011646
/
wechaty
与 Fork 源项目一致
Fork自
wechaty / wechaty
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
wechaty
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6283434b
编写于
6月 16, 2016
作者:
Huan (李卓桓)
浏览文件
操作
浏览文件
下载
差异文件
quit webdriver after unite test
上级
fb5ae183
0570d06a
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
67 addition
and
14 deletion
+67
-14
example/api-ai-bot.js
example/api-ai-bot.js
+2
-2
example/ding-dong-bot.js
example/ding-dong-bot.js
+2
-2
example/image-bot.js
example/image-bot.js
+1
-1
example/roger-bot.js
example/roger-bot.js
+1
-1
example/tuling123-bot.js
example/tuling123-bot.js
+2
-2
src/puppet-web-bridge.js
src/puppet-web-bridge.js
+24
-0
src/puppet-web-injectio.js
src/puppet-web-injectio.js
+29
-3
src/puppet-web.js
src/puppet-web.js
+2
-2
test/puppet-web-spec.js
test/puppet-web-spec.js
+4
-1
未找到文件。
example/api-ai-bot.js
浏览文件 @
6283434b
...
...
@@ -15,7 +15,7 @@ const co = require('co')
const
ApiAi
=
require
(
'
apiai
'
)
const
EventEmitter2
=
require
(
'
eventemitter2
'
)
const
Wechaty
=
require
(
'
..
/src/wechaty
'
)
const
Wechaty
=
require
(
'
..
'
)
//log.level = 'verbose'
// log.level = 'silly'
...
...
@@ -27,7 +27,7 @@ const Wechaty = require('../src/wechaty')
const
APIAI_API_KEY
=
'
7217d7bce18c4bcfbe04ba7bdfaf9c08
'
const
brainApiAi
=
ApiAi
(
APIAI_API_KEY
)
const
bot
=
new
Wechaty
({
head
:
false
})
const
bot
=
new
Wechaty
({
session
:
'
example-bot.wechaty.json
'
})
console
.
log
(
`
Welcome to api.AI Wechaty Bot.
...
...
example/ding-dong-bot.js
浏览文件 @
6283434b
const
log
=
require
(
'
npmlog
'
)
const
Wechaty
=
require
(
'
..
/src/wechaty
'
)
const
Wechaty
=
require
(
'
..
'
)
const
welcome
=
`
| __ __ _ _
...
...
@@ -26,7 +26,7 @@ Please wait... I'm trying to login in...
`
console
.
log
(
welcome
)
const
bot
=
new
Wechaty
({
session
:
'
example.wechaty.json
'
})
const
bot
=
new
Wechaty
({
session
:
'
example
-bot
.wechaty.json
'
})
bot
.
on
(
'
login
'
,
user
=>
log
.
info
(
'
Bot
'
,
`
${
user
.
name
()}
logined`
))
...
...
example/image-bot.js
浏览文件 @
6283434b
const
Wechaty
=
require
(
'
..
'
)
const
bot
=
new
Wechaty
({
session
:
'
example.wechaty.json
'
})
const
bot
=
new
Wechaty
({
session
:
'
example
-bot
.wechaty.json
'
})
bot
.
on
(
'
scan
'
,
({
url
,
code
})
=>
{
...
...
example/roger-bot.js
浏览文件 @
6283434b
const
Wechaty
=
require
(
'
..
'
)
const
bot
=
new
Wechaty
()
const
bot
=
new
Wechaty
(
/* no session name here */
)
bot
.
on
(
'
scan
'
,
({
url
,
code
})
=>
{
...
...
example/tuling123-bot.js
浏览文件 @
6283434b
...
...
@@ -15,7 +15,7 @@ const co = require('co')
const
Tuling123
=
require
(
'
tuling123-client
'
)
const
EventEmitter2
=
require
(
'
eventemitter2
'
)
const
Wechaty
=
require
(
'
..
/src/wechaty
'
)
const
Wechaty
=
require
(
'
..
'
)
//log.level = 'verbose'
// log.level = 'silly'
...
...
@@ -28,7 +28,7 @@ const Wechaty = require('../src/wechaty')
const
TULING123_API_KEY
=
'
18f25157e0446df58ade098479f74b21
'
const
brain
=
new
Tuling123
(
TULING123_API_KEY
)
const
bot
=
new
Wechaty
({
head
:
false
})
const
bot
=
new
Wechaty
({
session
:
'
example-bot.wechaty.json
'
})
console
.
log
(
`
Welcome to Tuling Wechaty Bot.
...
...
src/puppet-web-bridge.js
浏览文件 @
6283434b
...
...
@@ -250,6 +250,30 @@ e.getMsgVideo = function(e) {
return u.API_webwxgetvideo + "?msgid=" + e + "&skey=" + encodeURIComponent(c.getSkey())
}
<div class="picture"
ng-init="imageInit(message,message.MMPreviewSrc || message.MMThumbSrc || getMsgImg(message.MsgId,'slave'))">
<img class="msg-img" ng-style="message.MMImgStyle" ng-click="previewImg(message)"
ng-src="/cgi-bin/mmwebwx-bin/webwxgetmsgimg?&MsgID=6944236226252183282&skey=%40crypt_c117402d_2b2a8c58340c8f4b0a4570cb8f11a1e8&type=slave"
src="/cgi-bin/mmwebwx-bin/webwxgetmsgimg?&MsgID=6944236226252183282&skey=%40crypt_c117402d_2b2a8c58340c8f4b0a4570cb8f11a1e8&type=slave"
style="height: 100px; width: 75px;">
XMLHttpRequestOrig = XMLHttpRequest
XMLHttpRequest = function() { return new XMLHttpRequestOrig() }
*
.web_wechat_tab_launch-chat
contentChatController
e.getMsgImg = function(e, t, o) {
return o && "undefined" != typeof o.MMStatus && o.MMStatus != u.MSG_SEND_STATUS_SUCC ? void 0 : u.API_webwxgetmsgimg + "?&MsgID=" + e + "&skey=" + encodeURIComponent(c.getSkey()) + (t ? "&type=" + t : "")
}
,
e.getMsgVideo = function(e) {
return u.API_webwxgetvideo + "?msgid=" + e + "&skey=" + encodeURIComponent(c.getSkey())
}
<div class="picture"
ng-init="imageInit(message,message.MMPreviewSrc || message.MMThumbSrc || getMsgImg(message.MsgId,'slave'))">
<img class="msg-img" ng-style="message.MMImgStyle" ng-click="previewImg(message)"
...
...
src/puppet-web-injectio.js
浏览文件 @
6283434b
...
...
@@ -247,16 +247,42 @@ return (function(port) {
function
glueToAngular
()
{
var
injector
=
angular
.
element
(
document
).
injector
()
var
http
=
injector
.
get
(
'
$http
'
)
var
accountFactory
=
injector
.
get
(
'
accountFactory
'
)
var
appFactory
=
injector
.
get
(
'
appFactory
'
)
var
chatFactory
=
injector
.
get
(
'
chatFactory
'
)
var
confFactory
=
injector
.
get
(
'
confFactory
'
)
var
contactFactory
=
injector
.
get
(
'
contactFactory
'
)
var
confFactory
=
injector
.
get
(
'
confFactory
'
)
var
http
=
injector
.
get
(
'
$http
'
)
var
mmHttp
=
injector
.
get
(
'
mmHttp
'
)
var
rootScope
=
injector
.
get
(
'
$rootScope
'
)
var
appScope
=
angular
.
element
(
'
[ng-controller="appController"]
'
).
scope
()
var
rootScope
=
injector
.
get
(
'
$rootScope
'
)
var
loginScope
=
angular
.
element
(
'
[ng-controller="loginController"]
'
).
scope
()
/*
// method 1
appFactory.syncOrig = appFactory.sync
appFactory.syncCheckOrig = appFactory.syncCheck
appFactory.sync = function() { Wechaty.log('appFactory.sync() !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'); return appFactory.syncOrig(arguments) }
appFactory.syncCheck = function() { Wechaty.log('appFactory.syncCheck() !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'); return appFactory.syncCheckOrig(arguments) }
// method 2
$.ajaxOrig = $.ajax
$.ajax = function() { Wechaty.log('$.ajax() !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'); return $.ajaxOrig(arguments) }
$.ajax({
url: "https://wx.qq.com/zh_CN/htmledition/v2/images/webwxgeticon.jpg"
, type: "GET"
}).done(function (response) {
alert("success");
})
// method 3 - mmHttp
mmHttp.getOrig = mmHttp.get
mmHttp.get = function() { Wechaty.log('mmHttp.get() !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'); return mmHttp.getOrig(arguments) }
*/
/**
* generate $scope with a contoller (as it is not assigned in html staticly)
* https://github.com/angular/angular.js/blob/a4e60cb6970d8b6fa9e0af4b9f881ee3ba7fdc99/test/ng/controllerSpec.js#L24
...
...
src/puppet-web.js
浏览文件 @
6283434b
...
...
@@ -121,8 +121,8 @@ class PuppetWeb extends Puppet {
this
.
browser
.
on
(
'
dead
'
,
this
.
onBrowserDead
.
bind
(
this
))
// fastUrl is used to open in browser for we can set cookies.
const
fastUrl
=
'
https://res.wx.qq.com/zh_CN/htmledition/v2/images/icon/ico_loading28a2f7.gif
'
// const fastUrl = 'https://t.qq.com' // domain??? ssl ca name not match
// backup:
'https://res.wx.qq.com/zh_CN/htmledition/v2/images/icon/ico_loading28a2f7.gif'
const
fastUrl
=
'
https://wx.qq.com/zh_CN/htmledition/v2/images/webwxgeticon.jpg
'
return
co
.
call
(
this
,
function
*
()
{
yield
this
.
browser
.
init
()
...
...
test/puppet-web-spec.js
浏览文件 @
6283434b
...
...
@@ -138,7 +138,10 @@ test('Puppet Web watchdog timer', function(t) {
.
catch
(
e
=>
{
// Exception
t
.
fail
(
'
co exception:
'
+
e
.
message
)
})
.
then
(
t
.
end
)
// Finally
.
then
(()
=>
{
// Finally
pw
.
quit
()
.
then
(
t
.
end
)
})
return
/////////////////////////////////////////////////////////////////////////////
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录