Vbs Baidu Assistant

Source: Internet
Author: User

Run it and select:
1. I want to answer; 2. song search; 3. news search; 4. webpage Search; 5. post Bar search; 6. know the search; 7. image search; 8. video Search; 9; encyclopedia search;
Then, enter the content to be searched and go to the specified URL to automatically search. CopyCode The Code is as follows: xz = inputbox ("1. I want to answer; 2. song search; 3, news search; "& CHR (13) &" 4. webpage Search; 5. post Bar search; 6. know the search; "& CHR (13) &" 7. image search; 8. video Search; 9; encyclopedia search; "," Baidu assistant [null_vbt] "," ")
If Len (xz) = 0 then
Msgbox "not selected, script exited! ", 64," error"
Wscript. Quit
Else
Select case xz
Case 1
X = urlcode (inputbox ("Enter the question to answer", "Baidu I want to answer ",""))
If Len (x) = 0 then
Msgbox "NO content detected, script exited! ", 64," error"
Wscript. Quit
Else
Strurl = "http://zhidao.baidu.com/Q? WORD = "& X &" & Ct = 17 & Pn = 0 & Tn = ikaslist & Rn = 10 & lm = 65536 & Fr = answersearch_0"
End if
Case 2
X = urlcode (inputbox ("enter the name of the song you want to search", "Baidu song search ",""))
If Len (x) = 0 then
Msgbox "NO content detected, script exited! ", 64," error"
Wscript. Quit
Else
Strurl = "http://mp3.baidu.com/M? F = Ms & Tn = baidump3 & Ct = 134217728 & LF = & Rn = & word = "& X &" & lm =-1"
End if
Case 3
X = urlcode (inputbox ("Enter the news title to search", "Baidu news search ",""))
If Len (x) = 0 then
Msgbox "NO content detected, script exited! ", 64," error"
Wscript. Quit
Else
Strurl = "http://news.baidu.com/ns? CL = 2 & Rn = 20 & Tn = News & word = "& X &" & t = 1"
End if
Case 4
X = urlcode (inputbox ("Enter the content to search", "Baidu Web Search ",""))
If Len (x) = 0 then
Msgbox "NO content detected, script exited! ", 64," error"
Wscript. Quit
Else
Strurl = "http://www.baidu.com/s? CL = 3 & WD = "& X
End if
Case 5
X = urlcode (inputbox ("Enter the post title to search", "Baidu Post Bar search ",""))
If Len (x) = 0 then
Msgbox "NO content detected, script exited! ", 64," error"
Wscript. Quit
Else
Strurl = "http://tieba.baidu.com/F? KW = "& X
End if
Case 6
X = inputbox ("Enter the title you want to search for", "Baidu know search ","")
If Len (x) = 0 then
Msgbox "NO content detected, script exited! ", 64," error"
Wscript. Quit
Else
Strurl = "http://zhidao.baidu.com/Q? Ct = 17 & Pn = 0 & Tn = ikaslist & Rn = 10 & word = "& X
End if
Case 7
X = urlcode (inputbox ("Enter the image title to search", "Baidu image search ",""))
If Len (x) = 0 then
Msgbox "NO content detected, script exited! ", 64," error"
Wscript. Quit
Else
Strurl = "http://image.baidu.com/I? Tn = baiduimage & Ct = 201326592 & lm =-1 & CL = 2 & word = "& X &" & t = 3"
End if
Case 8
X = urlcode (inputbox ("Enter the video title to search", "Baidu Video Search ",""))
If Len (x) = 0 then
Msgbox "NO content detected, script exited! ", 64," error"
Wscript. Quit
Else
Strurl = "http://video.baidu.com/V? Ct = 301989888 & Rn = 20 & Pn = 0 & DB = 0 & s = 7 & word = "& X
End if
Case 9
X = urlcode (inputbox ("Enter the encyclopedia title to search", "Baidu encyclopedia search ",""))
If Len (x) = 0 then
Msgbox "NO content detected, script exited! ", 64," error"
Wscript. Quit
Else
Strurl = "http://baike.baidu.com/W? Ct = 17 & lm = 0 & Tn = baiduwikisearch & Pn = 0 & Rn = 10 & word = "& X
End if
End select
End if
Set objie = Createobject ("internetexplorer. application ")
Objie. Visible = true
Objie. navigate strurl
Function urlcode (inpstr)
Dim inpasc, I
For I = 1 to Len (inpstr)
Inpasc = ASC (mid (inpstr, I, 1 ))
If (inpasc <58) and (inpasc> 47) or (inpasc <91) and (inpasc> 64) or (inpasc <123) and (inpasc> 96) then
Urlcode = urlcode & CHR (inpasc)
Else
Urlcode = urlcode & "%" & Mid (TRIM (hex (inpasc), 1, 2) & "%" & Mid (TRIM (hex (inpasc), 3, 2)
End if
Next
End Function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.