{"id":194,"date":"2006-05-21T02:29:40","date_gmt":"2006-05-21T02:29:40","guid":{"rendered":"http:\/\/www.icocean.com\/blog\/?p=194"},"modified":"1970-01-01T07:00:00","modified_gmt":"1970-01-01T07:00:00","slug":"baidu%E6%90%9C%E7%B4%A2%E5%B0%8F%E5%81%B7asp%E7%89%88","status":"publish","type":"post","link":"https:\/\/www.icocean.com\/blog\/?p=194","title":{"rendered":"Baidu\u641c\u7d22\u5c0f\u5077ASP\u7248"},"content":{"rendered":"<p>Baidu\u641c\u7d22\u5c0f\u5077ASP\u7248 <\/p>\n<p>&lt;%<br \/>Function bytes2BSTR(vIn)<br \/>strReturn = &quot;&quot;<br \/>For i = 1 To LenB(vIn)<br \/>ThisCharCode = AscB(MidB(vIn,i,1))<br \/>If ThisCharCode &lt; &amp;H80 Then<br \/>strReturn = strReturn &amp; Chr(ThisCharCode)<br \/>Else<br \/>NextCharCode = AscB(MidB(vIn,i+1,1))<br \/>strReturn = strReturn &amp; Chr(CLng(ThisCharCode) * &amp;H100 + CInt(NextCharCode))<br \/>i = i + 1<br \/>End If<br \/>Next<br \/>bytes2BSTR = ubb(strReturn)<br \/>End Function <\/p>\n<p>Function dq(key)<br \/>dim XmlHttp<br \/>set XmlHttp = CreateObject(&quot;Microsoft.XMLHTTP&quot;)<br \/>XmlHttp.Open &quot;GET&quot;,&quot;http:\/\/www.baidu.com\/s?wd=&quot;&amp;key&amp;&quot;&amp;pn=&quot;&amp;request(&quot;pn&quot;), false <br \/>XmlHttp.setRequestHeader &quot;Content-Type&quot;,&quot;text\/XML&quot; <br \/>XmlHttp.Send<br \/>dq = bytes2BSTR(XmlHttp.responseBody)<br \/>End Function<\/p>\n<p>Function BR(Str)<br \/>Str = Replace(Str,&quot;{br}&quot;,&quot;&lt;br&gt;&quot;)<br \/>Str = Replace(Str,vbcrlf,&quot;&lt;br&gt;&quot;)<br \/>Str = Replace(Str,&quot;&lt;br&gt; &lt;br&gt;&quot;,&quot;&lt;br&gt;&quot;)<br \/>Str = Replace(Str,&quot;&lt;br&gt;&lt;br&gt;&quot;,&quot;&lt;br&gt;&quot;)<br \/>Str = Replace(Str,&quot;&lt;br&gt;&lt;br&gt;&quot;,&quot;&lt;br&gt;&quot;)<br \/>BR = Str<br \/>End Function<\/p>\n<p>function ubb(str)<\/p>\n<p>if instr(str,&quot;\u627e\u5230\u76f8\u5173\u7f51\u9875&quot;) = 0 then<br \/>ubb = &quot;\u6ca1\u6709\u641c\u7d22\u5230\u4efb\u4f55\u5185\u5bb9&quot;<br \/>exit function<br \/>end if<\/p>\n<p>str = Replace(str,vbcrlf,&quot;{br}&quot;)<br \/>str = Replace(str,&quot;&lt;br&gt;&quot;,&quot;{br}&quot;)<br \/>str = Replace(str,&quot;&lt;\/td&gt;&quot;,&quot;&lt;\/td&gt;&quot;&amp;vbcrlf)<br \/>str = Replace(str,&quot;&lt;td&quot;,vbcrlf&amp;&quot;&lt;td&quot;)<\/p>\n<p>dim re,Match,Matches <br \/>set re = New RegExp<br \/>re.Global = True<br \/>re.IgnoreCase = True<\/p>\n<p>re.Pattern=&quot;.*&lt;td class=f&gt;(.*)&lt;\/td&gt;&quot;<\/p>\n<p>Set Matches = re.Execute(str)<\/p>\n<p>For Each Match in Matches<br \/>ubb=ubb&amp;BR(Match.value)<br \/>next<br \/>re.Pattern=&quot;(- &lt;a .[^&lt;]*&gt;\u767e\u5ea6\u5feb\u7167&lt;\/a&gt;)&quot;<br \/>ubb = re.replace(ubb,&quot;&quot;)<br \/>re.Pattern=&quot;(&lt;a class=&quot;&quot;m&quot;&quot;.[^&lt;]*&gt;.[^&lt;]*&lt;\/a&gt;)&quot;<br \/>ubb = re.replace(ubb,&quot;&quot;)<br \/>re.Pattern=&quot;(&lt;font color=#008000&gt;.[^&lt;]*&lt;\/font&gt;)&quot;<br \/>ubb = re.replace(ubb,&quot;&lt;hr&gt;&quot;) &#39;\u6bcf\u4e00\u6761\u4fe1\u606f\u7684\u95f4\u9694<br \/>ubb = Replace(ubb,&quot;&lt;td class=f&gt;&quot;,&quot;&quot;)<br \/>ubb = Replace(ubb,&quot;&lt;\/td&gt;&quot;,&quot;&quot;)<br \/>ubb = BR(UBB)<\/p>\n<p>re.Pattern=&quot;(\u627e\u5230\u76f8\u5173\u7f51\u9875.*\u79d2)&quot;<br \/>Set Matches = re.Execute(str)<br \/>set Match = Matches(0)<br \/>ubb = ubb &amp; Match &amp; &quot;&lt;br&gt;&quot;<\/p>\n<p>str = Replace(str,&quot;&lt;\/div&gt;&quot;,&quot;&lt;\/div&gt;&quot;&amp;vbcrlf)<\/p>\n<p>re.Pattern=&quot;&lt;div class=&quot;&quot;p&quot;&quot;&gt;(.*)&lt;\/div&gt;&quot;<br \/>Set Matches = re.Execute(str)<br \/>set Match = Matches(0)<br \/>Dim TheLink<br \/>TheLink = Match<br \/>re.Pattern=&quot;href=s?(.[^&gt;]*)&quot;<br \/>TheLink = re.replace(TheLink,&quot;href=&quot;&quot;$1&quot;&quot;&quot;)<\/p>\n<p>ubb = ubb &amp; TheLink<br \/>end function<\/p>\n<p>if len(request(&quot;wd&quot;)) &gt; 0 then<br \/>response.write dq(request(&quot;wd&quot;))<br \/>end if<br \/>%&gt;<br \/>&lt;form method=post action=&quot;?&quot;&gt;<br \/>&lt;input type=&quot;text&quot; name=&quot;wd&quot;&gt; &lt;input type=&quot;submit&quot;&gt;<br \/>&lt;\/form&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Baidu\u641c\u7d22\u5c0f\u5077ASP\u7248 &lt;%Function bytes2BSTR(vIn)strReturn =  <a href='https:\/\/www.icocean.com\/blog\/?p=194' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-194","post","type-post","status-publish","format-standard","hentry","category-4","category-4-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=194"}],"version-history":[{"count":0,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/194\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}