roro_support 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +5 -0
- data/lib/roro_support.rb +4 -2
- data/lib/roro_support/array.rb +32 -0
- data/lib/roro_support/bash.rb +12 -4
- data/lib/roro_support/crawler.rb +106 -7
- data/lib/roro_support/git.rb +63 -60
- data/lib/roro_support/kernel.rb +9 -0
- data/lib/roro_support/log.rb +18 -0
- data/lib/roro_support/misc.rb +108 -0
- data/lib/roro_support/string_handler.rb +2 -0
- data/lib/roro_support/version.rb +1 -1
- data/lib/roro_support/watir.rb +5 -4
- data/lib/roro_support/watir/browser.rb +3 -3
- data/lib/roro_support/watir/element.rb +10 -10
- data/lib/roro_support/watir/element_collection.rb +18 -21
- data/spec/fixtures/baidu.html +440 -0
- data/spec/lib/roro_support/array_spec.rb +27 -0
- data/spec/lib/roro_support/crawler_spec.rb +112 -0
- data/spec/lib/roro_support/git_spec.rb +23 -23
- data/spec/lib/roro_support/log/roro.log +29 -0
- data/spec/lib/roro_support/log_spec.rb +24 -0
- data/spec/lib/roro_support/misc_spec.rb +57 -0
- data/spec/lib/roro_support/watir/browser_spec.rb +6 -5
- data/spec/lib/roro_support/watir/element_collection_spec.rb +9 -0
- data/spec/spec_helper.rb +6 -4
- metadata +35 -15
- data/lib/roro_support/error.rb +0 -11
- data/lib/roro_support/methods.rb +0 -21
- data/lib/roro_support/req.rb +0 -37
- data/spec/fixtures/spec.html +0 -14
- data/spec/fixtures/spec_dir2/req_test_list.rb +0 -1
- data/spec/lib/roro_support/req_spec.rb +0 -16
- data/spec/lib/roro_support/watir/crawler_spec.rb +0 -13
- data/spec/lib/roro_support/watir/methods_spec.rb +0 -18
data/lib/roro_support/version.rb
CHANGED
data/lib/roro_support/watir.rb
CHANGED
@@ -2,7 +2,8 @@ require 'watir-webdriver'
|
|
2
2
|
require 'active_support'
|
3
3
|
require 'headless'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
$LOAD_PATH.unshift File.expand_path('../watir', __FILE__)
|
6
|
+
|
7
|
+
require 'element'
|
8
|
+
require 'browser'
|
9
|
+
require 'element_collection'
|
@@ -1,10 +1,10 @@
|
|
1
|
-
module RoRoSupport
|
2
|
-
module
|
3
|
-
|
4
|
-
def attribute selector
|
5
|
-
assert_exists
|
6
|
-
@element.attribute selector
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
1
|
+
#module RoRoSupport
|
2
|
+
# module WatirDSL
|
3
|
+
# ::Watir::Element.class_eval do
|
4
|
+
# def attribute selector
|
5
|
+
# assert_exists
|
6
|
+
# @element.attribute selector
|
7
|
+
# end
|
8
|
+
# end
|
9
|
+
# end
|
10
|
+
#end
|
@@ -1,21 +1,18 @@
|
|
1
|
-
module RoRoSupport
|
2
|
-
module
|
3
|
-
|
4
|
-
def collect *selectors
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
result
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
1
|
+
#module RoRoSupport
|
2
|
+
# module WatirDSL
|
3
|
+
# ::Watir::ElementCollection.class_eval do
|
4
|
+
# def collect *selectors
|
5
|
+
# result = []
|
6
|
+
# link_contents = []
|
7
|
+
# self.each do |tag|
|
8
|
+
# selectors.each do |selector|
|
9
|
+
# link_contents << tag.attribute(selector)
|
10
|
+
# end
|
11
|
+
# result << link_contents
|
12
|
+
# end
|
13
|
+
#
|
14
|
+
# eval "return #{result.to_args}"
|
15
|
+
# end
|
16
|
+
# end
|
17
|
+
# end
|
18
|
+
#end
|
@@ -0,0 +1,440 @@
|
|
1
|
+
<!DOCTYPE html><!--STATUS OK-->
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="content-type" content="text/html;charset=utf-8">
|
5
|
+
<title>百度一下,你就知道</title>
|
6
|
+
<style>html, body {
|
7
|
+
height: 100%
|
8
|
+
}
|
9
|
+
|
10
|
+
html {
|
11
|
+
overflow-y: auto
|
12
|
+
}
|
13
|
+
|
14
|
+
#wrapper {
|
15
|
+
position: relative;
|
16
|
+
_position:;
|
17
|
+
min-height: 100%
|
18
|
+
}
|
19
|
+
|
20
|
+
#content {
|
21
|
+
padding-bottom: 100px;
|
22
|
+
text-align: center
|
23
|
+
}
|
24
|
+
|
25
|
+
#ftCon {
|
26
|
+
height: 100px;
|
27
|
+
position: absolute;
|
28
|
+
bottom: 44px;
|
29
|
+
text-align: center;
|
30
|
+
width: 100%;
|
31
|
+
margin: 0 auto;
|
32
|
+
z-index: 0;
|
33
|
+
overflow: hidden
|
34
|
+
}
|
35
|
+
|
36
|
+
#ftConw {
|
37
|
+
width: 720px;
|
38
|
+
margin: 0 auto
|
39
|
+
}
|
40
|
+
|
41
|
+
body {
|
42
|
+
font: 12px arial;
|
43
|
+
text-align:;
|
44
|
+
background: #fff
|
45
|
+
}
|
46
|
+
|
47
|
+
body, p, form, ul, li {
|
48
|
+
margin: 0;
|
49
|
+
padding: 0;
|
50
|
+
list-style: none
|
51
|
+
}
|
52
|
+
|
53
|
+
body, form, #fm {
|
54
|
+
position: relative
|
55
|
+
}
|
56
|
+
|
57
|
+
td {
|
58
|
+
text-align: left
|
59
|
+
}
|
60
|
+
|
61
|
+
img {
|
62
|
+
border: 0
|
63
|
+
}
|
64
|
+
|
65
|
+
a {
|
66
|
+
color: #00c
|
67
|
+
}
|
68
|
+
|
69
|
+
a:active {
|
70
|
+
color: #f60
|
71
|
+
}
|
72
|
+
|
73
|
+
#u {
|
74
|
+
color: #999;
|
75
|
+
padding: 4px 10px 5px 0;
|
76
|
+
text-align: right
|
77
|
+
}
|
78
|
+
|
79
|
+
#u a {
|
80
|
+
margin: 0 5px
|
81
|
+
}
|
82
|
+
|
83
|
+
#u .reg {
|
84
|
+
margin: 0
|
85
|
+
}
|
86
|
+
|
87
|
+
#m {
|
88
|
+
width: 720px;
|
89
|
+
margin: 0 auto
|
90
|
+
}
|
91
|
+
|
92
|
+
#nv a, #nv b, .btn, #lk {
|
93
|
+
font-size: 14px
|
94
|
+
}
|
95
|
+
|
96
|
+
#fm {
|
97
|
+
padding-left: 110px;
|
98
|
+
text-align: left;
|
99
|
+
z-index: 1
|
100
|
+
}
|
101
|
+
|
102
|
+
input {
|
103
|
+
border: 0;
|
104
|
+
padding: 0
|
105
|
+
}
|
106
|
+
|
107
|
+
#nv {
|
108
|
+
height: 19px;
|
109
|
+
font-size: 16px;
|
110
|
+
margin: 0 0 4px;
|
111
|
+
text-align: left;
|
112
|
+
text-indent: 137px
|
113
|
+
}
|
114
|
+
|
115
|
+
.s_ipt_wr {
|
116
|
+
width: 418px;
|
117
|
+
height: 30px;
|
118
|
+
display: inline-block;
|
119
|
+
margin-right: 5px;
|
120
|
+
background: url(/img/i-1.0.0.png) no-repeat -304px 0;
|
121
|
+
border: 1px solid #b6b6b6;
|
122
|
+
border-color: #9a9a9a #cdcdcd #cdcdcd #9a9a9a;
|
123
|
+
vertical-align: top
|
124
|
+
}
|
125
|
+
|
126
|
+
.s_ipt {
|
127
|
+
width: 405px;
|
128
|
+
height: 22px;
|
129
|
+
font: 16px/22px arial;
|
130
|
+
margin: 5px 0 0 7px;
|
131
|
+
background: #fff;
|
132
|
+
outline: 0;
|
133
|
+
-webkit-appearance: none
|
134
|
+
}
|
135
|
+
|
136
|
+
.s_btn {
|
137
|
+
width: 95px;
|
138
|
+
height: 32px;
|
139
|
+
padding-top: 2 px\9;
|
140
|
+
font-size: 14px;
|
141
|
+
background: #ddd url(/img/i-1.0.0.png);
|
142
|
+
cursor: pointer
|
143
|
+
}
|
144
|
+
|
145
|
+
.s_btn_h {
|
146
|
+
background-position: -100px 0
|
147
|
+
}
|
148
|
+
|
149
|
+
.s_btn_wr {
|
150
|
+
width: 97px;
|
151
|
+
height: 34px;
|
152
|
+
display: inline-block;
|
153
|
+
background: url(/img/i-1.0.0.png) no-repeat -202px 0;
|
154
|
+
*position: relative;
|
155
|
+
z-index: 0;
|
156
|
+
vertical-align: top
|
157
|
+
}
|
158
|
+
|
159
|
+
#lg img {
|
160
|
+
vertical-align: top;
|
161
|
+
margin-bottom: 3px
|
162
|
+
}
|
163
|
+
|
164
|
+
#lk {
|
165
|
+
margin: 33px 0
|
166
|
+
}
|
167
|
+
|
168
|
+
#lk span {
|
169
|
+
font: 14px "宋体"
|
170
|
+
}
|
171
|
+
|
172
|
+
#lm {
|
173
|
+
height: 60px
|
174
|
+
}
|
175
|
+
|
176
|
+
#lh {
|
177
|
+
margin: 16px 0 5px;
|
178
|
+
word-spacing: 3px
|
179
|
+
}
|
180
|
+
|
181
|
+
.tools {
|
182
|
+
position: absolute;
|
183
|
+
top: -4px;
|
184
|
+
*top: 10px;
|
185
|
+
right: 7px
|
186
|
+
}
|
187
|
+
|
188
|
+
#mHolder {
|
189
|
+
width: 62px;
|
190
|
+
position: relative;
|
191
|
+
z-index: 296;
|
192
|
+
display: none
|
193
|
+
}
|
194
|
+
|
195
|
+
#mCon {
|
196
|
+
height: 18px;
|
197
|
+
line-height: 18px;
|
198
|
+
position: absolute;
|
199
|
+
cursor: pointer;
|
200
|
+
padding: 0 18px 0 0;
|
201
|
+
background: url(/img/bg-1.0.0.gif) no-repeat right -134px;
|
202
|
+
background-position: right -136 px\9
|
203
|
+
}
|
204
|
+
|
205
|
+
#mCon span {
|
206
|
+
color: #00c;
|
207
|
+
cursor: default;
|
208
|
+
display: block
|
209
|
+
}
|
210
|
+
|
211
|
+
#mCon .hw {
|
212
|
+
text-decoration: underline;
|
213
|
+
cursor: pointer
|
214
|
+
}
|
215
|
+
|
216
|
+
#mMenu a {
|
217
|
+
width: 100%;
|
218
|
+
height: 100%;
|
219
|
+
display: block;
|
220
|
+
line-height: 22px;
|
221
|
+
text-indent: 6px;
|
222
|
+
text-decoration: none;
|
223
|
+
filter: none\9
|
224
|
+
}
|
225
|
+
|
226
|
+
#mMenu, #user ul {
|
227
|
+
box-shadow: 1px 1px 2px #ccc;
|
228
|
+
-moz-box-shadow: 1px 1px 2px #ccc;
|
229
|
+
-webkit-box-shadow: 1px 1px 2px #ccc;
|
230
|
+
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=2, Direction=135, Color="#cccccc") \9
|
231
|
+
}
|
232
|
+
|
233
|
+
#mMenu {
|
234
|
+
width: 56px;
|
235
|
+
border: 1px solid #9b9b9b;
|
236
|
+
list-style: none;
|
237
|
+
position: absolute;
|
238
|
+
right: 27px;
|
239
|
+
top: 28px;
|
240
|
+
display: none;
|
241
|
+
background: #fff
|
242
|
+
}
|
243
|
+
|
244
|
+
#mMenu a:hover {
|
245
|
+
background: #ebebeb
|
246
|
+
}
|
247
|
+
|
248
|
+
#mMenu .ln {
|
249
|
+
height: 1px;
|
250
|
+
background: #ebebeb;
|
251
|
+
overflow: hidden;
|
252
|
+
font-size: 1px;
|
253
|
+
line-height: 1px;
|
254
|
+
margin-top: -1px
|
255
|
+
}
|
256
|
+
|
257
|
+
#cp, #cp a {
|
258
|
+
color: #666
|
259
|
+
}
|
260
|
+
|
261
|
+
#seth {
|
262
|
+
display: none;
|
263
|
+
behavior: url(#default#homepage)
|
264
|
+
}
|
265
|
+
|
266
|
+
#setf {
|
267
|
+
display: none
|
268
|
+
}
|
269
|
+
|
270
|
+
#sekj {
|
271
|
+
margin-left: 14px
|
272
|
+
}
|
273
|
+
|
274
|
+
#shouji {
|
275
|
+
margin-right: 14px
|
276
|
+
}</style>
|
277
|
+
<script>function h(obj) {
|
278
|
+
obj.style.behavior = 'url(#default#homepage)';
|
279
|
+
var a = obj.setHomePage('http://www.baidu.com/');
|
280
|
+
}</script>
|
281
|
+
</head>
|
282
|
+
<body>
|
283
|
+
<div id="wrapper">
|
284
|
+
<div id="content">
|
285
|
+
<div id="u"><a href="http://www.baidu.com/gaoji/preferences.html" name="tj_setting">搜索设置</a>|<a
|
286
|
+
href="https://passport.baidu.com/v2/?login&tpl=mn&u=http%3A%2F%2Fwww.baidu.com%2F" name="tj_login" id="lb"
|
287
|
+
onclick="return false;">登录</a><a
|
288
|
+
href="https://passport.baidu.com/v2/?reg®Type=1&tpl=mn&u=http%3A%2F%2Fwww.baidu.com%2F" target="_blank"
|
289
|
+
name="tj_reg" class="reg">注册</a></div>
|
290
|
+
<div id="m"><p id="lg"><img src="http://www.baidu.com/img/bdlogo.gif" width="270" height="129"></p>
|
291
|
+
|
292
|
+
<p id="nv"><a href="http://news.baidu.com">新 闻</a> <b>网 页</b> <a
|
293
|
+
href="http://tieba.baidu.com">贴 吧</a> <a href="http://zhidao.baidu.com">知 道</a> <a
|
294
|
+
href="http://music.baidu.com">音 乐</a> <a href="http://image.baidu.com">图 片</a> <a
|
295
|
+
href="http://v.baidu.com">视 频</a> <a href="http://map.baidu.com">地 图</a></p>
|
296
|
+
|
297
|
+
<div id="fm">
|
298
|
+
<form name="f" action="/s"><span class="s_ipt_wr"><input type="text" name="wd" id="kw" maxlength="100"
|
299
|
+
class="s_ipt"></span><input type="hidden" name="rsv_bp"
|
300
|
+
value="0"><input
|
301
|
+
type=hidden name=ch value=""><input type=hidden name=tn value="baidu"><input type=hidden name=bar
|
302
|
+
value=""><input type="hidden"
|
303
|
+
name="rsv_spt"
|
304
|
+
value="3"><input
|
305
|
+
type="hidden" name="ie" value="utf-8"><span class="s_btn_wr"><input type="submit" value="百度一下" id="su"
|
306
|
+
class="s_btn"
|
307
|
+
onmousedown="this.className='s_btn s_btn_h'"
|
308
|
+
onmouseout="this.className='s_btn'"></span>
|
309
|
+
</form>
|
310
|
+
<span class="tools"><span id="mHolder"><div id="mCon"><span>输入法</span></div></span></span>
|
311
|
+
<ul id="mMenu">
|
312
|
+
<li><a href="#" name="ime_hw">手写</a></li>
|
313
|
+
<li><a href="#" name="ime_py">拼音</a></li>
|
314
|
+
<li class="ln"></li>
|
315
|
+
<li><a href="#" name="ime_cl">关闭</a></li>
|
316
|
+
</ul>
|
317
|
+
</div>
|
318
|
+
<p id="lk"><a href="http://baike.baidu.com">百科</a> <a href="http://wenku.baidu.com">文库</a> <a
|
319
|
+
href="http://www.hao123.com">hao123</a><span> | <a href="http://www.baidu.com/more/">更多>></a></span>
|
320
|
+
</p>
|
321
|
+
|
322
|
+
<p id="lm"></p></div>
|
323
|
+
</div>
|
324
|
+
<div id="ftCon">
|
325
|
+
<div id="ftConw"><p><a id="seth" onClick="h(this)" href="/"
|
326
|
+
onmousedown="return ns_c({'fm':'behs','tab':'homepage','pos':0})">把百度设为主页</a><a id="setf"
|
327
|
+
href="http://www.baidu.com/cache/sethelp/index.html"
|
328
|
+
onmousedown="return ns_c({'fm':'behs','tab':'favorites','pos':0})"
|
329
|
+
target="_blank">把百度设为主页</a><span
|
330
|
+
id="sekj"><a href="http://liulanqi.baidu.com/ps.php" target="_blank"
|
331
|
+
onmousedown="return ns_c({'fm':'behs','tab':'bdbrwlk','pos':1})">安装百度浏览器</a></span></p>
|
332
|
+
|
333
|
+
<p id="lh"><a href="http://e.baidu.com/?refer=888"
|
334
|
+
onmousedown="return ns_c({'fm':'behs','tab':'btlink','pos':2})">加入百度推广</a> | <a
|
335
|
+
onmousedown="return ns_c({'fm':'behs','tab':'tj_bang'})" href="http://top.baidu.com">搜索风云榜</a> | <a
|
336
|
+
onmousedown="return ns_c({'fm':'behs','tab':'tj_about'})" href="http://home.baidu.com">关于百度</a> | <a
|
337
|
+
onmousedown="return ns_c({'fm':'behs','tab':'tj_about_en'})" href="http://ir.baidu.com">About Baidu</a></p>
|
338
|
+
|
339
|
+
<p id="cp">©2013 Baidu <a href="/duty/" name="tj_duty">使用百度前必读</a> 京ICP证030173号 <img
|
340
|
+
src="http://www.baidu.com/cache/global/img/gs.gif"></p></div>
|
341
|
+
</div>
|
342
|
+
</div>
|
343
|
+
</body>
|
344
|
+
<script>var bds = {se: {}, comm: {ishome: 1, sid: "3146_1451_2784_2981_3225", user: "", username: "", sugHost: "http://esug.baidu.com/su", personalData: "", loginAction: []}}</script>
|
345
|
+
<script type="text/javascript" src="http://s1.bdstatic.com/r/www/cache/static/global/js/home_299f7566.js"
|
346
|
+
charset="utf-8"></script>
|
347
|
+
<script>var bdUser = null;
|
348
|
+
var w = window, d = document, n = navigator, k = d.f.wd, a = d.getElementById("nv").getElementsByTagName("a"), isIE = n.userAgent.indexOf("MSIE") != -1 && !window.opera;
|
349
|
+
(function () {
|
350
|
+
if (/q=([^&]+)/.test(location.search)) {
|
351
|
+
k.value = decodeURIComponent(RegExp["\x241"])
|
352
|
+
}
|
353
|
+
})();
|
354
|
+
if (n.cookieEnabled) {
|
355
|
+
bds.se.sug();
|
356
|
+
}
|
357
|
+
;
|
358
|
+
function addEV(o, e, f) {
|
359
|
+
if (w.attachEvent) {
|
360
|
+
o.attachEvent("on" + e, f);
|
361
|
+
} else if (w.addEventListener) {
|
362
|
+
o.addEventListener(e, f, false);
|
363
|
+
}
|
364
|
+
}
|
365
|
+
function G(id) {
|
366
|
+
return d.getElementById(id);
|
367
|
+
}
|
368
|
+
function ns_c(q) {
|
369
|
+
var p = encodeURIComponent(window.document.location.href), sQ = '', sV = '', mu = '', img = window["BD_PS_C" + (new Date()).getTime()] = new Image();
|
370
|
+
for (v in q) {
|
371
|
+
sV = q[v];
|
372
|
+
sQ += v + "=" + sV + "&";
|
373
|
+
}
|
374
|
+
mu = "&mu=" + p;
|
375
|
+
img.src = "http://nsclick.baidu.com/v.gif?pid=201&pj=www&rsv_sid=3146_1451_2784_2981_3225&" + sQ + "path=" + p + "&t=" + new Date().getTime();
|
376
|
+
return true;
|
377
|
+
}
|
378
|
+
if (/\bbdime=[12]/.test(d.cookie)) {
|
379
|
+
document.write('<script src="' + "http://s1.bdstatic.com/r/www/cache/static/ime/js/openime_b157f449.js" + '" charset="utf-8"><\/script>');
|
380
|
+
}
|
381
|
+
(function () {
|
382
|
+
var u = G("u").getElementsByTagName("a"), nv = G("nv").getElementsByTagName("a"), lk = G("lk").getElementsByTagName("a"), un = "";
|
383
|
+
var tj_nv = ["news", "tieba", "zhidao", "mp3", "img", "video", "map"];
|
384
|
+
var tj_lk = ["baike", "wenku", "hao123", "more"];
|
385
|
+
un = bds.comm.user == "" ? "" : bds.comm.user;
|
386
|
+
function _addTJ(obj) {
|
387
|
+
addEV(obj, "mousedown", function (e) {
|
388
|
+
var e = e || window.event;
|
389
|
+
var target = e.target || e.srcElement;
|
390
|
+
ns_c({'fm': 'behs', 'tab': target.name || 'tj_user', 'un': encodeURIComponent(un)});
|
391
|
+
});
|
392
|
+
}
|
393
|
+
|
394
|
+
for (var i = 0; i < u.length; i++) {
|
395
|
+
_addTJ(u[i]);
|
396
|
+
}
|
397
|
+
for (var i = 0; i < nv.length; i++) {
|
398
|
+
nv[i].name = 'tj_' + tj_nv[i];
|
399
|
+
}
|
400
|
+
for (var i = 0; i < lk.length; i++) {
|
401
|
+
lk[i].name = 'tj_' + tj_lk[i];
|
402
|
+
}
|
403
|
+
})();
|
404
|
+
(function () {
|
405
|
+
var links = {'tj_news': ['word', 'http://news.baidu.com/ns?tn=news&cl=2&rn=20&ct=1&ie=utf-8'], 'tj_tieba': ['kw', 'http://tieba.baidu.com/f?ie=utf-8'], 'tj_zhidao': ['word', 'http://zhidao.baidu.com/search?pn=0&rn=10&lm=0'], 'tj_mp3': ['key', 'http://music.baidu.com/search?fr=ps&ie=utf-8'], 'tj_img': ['word', 'http://image.baidu.com/i?ct=201326592&cl=2&nc=1&lm=-1&st=-1&tn=baiduimage&istype=2&fm=&pv=&z=0&ie=utf-8'], 'tj_video': ['word', 'http://video.baidu.com/v?ct=301989888&s=25&ie=utf-8'], 'tj_map': ['wd', 'http://map.baidu.com/?newmap=1&ie=utf-8&s=s'], 'tj_baike': ['word', 'http://baike.baidu.com/search/word?pic=1&sug=1&enc=utf8'], 'tj_wenku': ['word', 'http://wenku.baidu.com/search?ie=utf-8']};
|
406
|
+
var domArr = [G('nv'), G('lk'), G('cp')], kw = G('kw');
|
407
|
+
for (var i = 0, l = domArr.length; i < l; i++) {
|
408
|
+
domArr[i].onmousedown = function (e) {
|
409
|
+
e = e || window.event;
|
410
|
+
var target = e.target || e.srcElement, name = target.getAttribute('name'), items = links[name], reg = new RegExp('^\\s+|\\s+\x24'), key = kw.value.replace(reg, '');
|
411
|
+
if (items) {
|
412
|
+
if (key.length > 0) {
|
413
|
+
var wd = items[0], url = items[1], url = url + ( name === 'tj_map' ? encodeURIComponent('&' + wd + '=' + key) : ( ( url.indexOf('?') > 0 ? '&' : '?' ) + wd + '=' + encodeURIComponent(key) ) );
|
414
|
+
target.href = url;
|
415
|
+
} else {
|
416
|
+
target.href = target.href.match(new RegExp('^http:\/\/.+\.baidu\.com'))[0];
|
417
|
+
}
|
418
|
+
}
|
419
|
+
name && ns_c({'fm': 'behs', 'tab': name, 'query': encodeURIComponent(key), 'un': encodeURIComponent(bds.comm.user || '') });
|
420
|
+
};
|
421
|
+
}
|
422
|
+
})();
|
423
|
+
addEV(w, "load", function () {
|
424
|
+
k.focus()
|
425
|
+
});
|
426
|
+
w.onunload = function () {
|
427
|
+
};</script>
|
428
|
+
<script type="text/javascript"
|
429
|
+
src="http://s1.bdstatic.com/r/www/cache/static/global/js/tangram-1.3.4c1.0_07038476.js"></script>
|
430
|
+
<script type="text/javascript" src="http://s1.bdstatic.com/r/www/cache/static/user/js/u_5990d9fd.js"
|
431
|
+
charset="utf-8"></script>
|
432
|
+
<script>try {
|
433
|
+
document.cookie = "WWW_ST=;expires=Sat, 01 Jan 2000 00:00:00 GMT";
|
434
|
+
baidu.on(document.forms[0], "submit", function () {
|
435
|
+
var _t = new Date().getTime();
|
436
|
+
document.cookie = "WWW_ST=" + _t + ";expires=" + new Date(_t + 10000).toGMTString()
|
437
|
+
})
|
438
|
+
} catch (e) {
|
439
|
+
}</script>
|
440
|
+
</html><!--07dabc2f73ee8a67-->
|