July 18th, 2013, 10:19 AM
Search thread in rank search
Hi, I'm currently trying to resurrect an old script that was used to search the search engines to find the rank of a keyword. It used to work well until Google changed something. This is the part of the file that is the search string:
searchUrl = "http://www.google.com/search?" & strQuery & "&num=100"
and this is the function:
function googlecom(url, kwa, kwb, kwc) dim objXmlHttp, strHTML, strQuery, loc, pos, tmpURL, found, tmpLoc, searchURL strQuery = Server.URLEncode(Trim(kwa)) if kwb <> "" then strQuery = strQuery & "+" & Server.URLEncode(Trim(kwb)) if kwc <> "" then strQuery = strQuery & "+" & Server.URLEncode(Trim(kwc)) strQuery = replace(strQuery,"%A0","%20") 'searchUrl = "http://" & findmyrankport & "/engineme.asp?engine=googlecom&q=" & strQuery 'searchUrl = "http://www.google.co.uk/search?hl=en&ie=UTF-8&oe=UTF-8&q=" & strQuery & "&btnG=Google+Search&meta=cr%3DcountryUK%7CcountryGB" searchUrl = "http://www.google.com/search?" & strQuery & "&num=100" ' This engine cannot deal with searching for www.neomancerco.uk/stuffs and things set objXmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP") objXmlHttp.setTimeouts 30000, 30000, 30000, 30000 objXmlHttp.open "GET", searchUrl, False objXmlHttp.SetRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)" objXmlHttp.send strHTML = objXmlHttp.responseText set objXmlHttp = Nothing
July 18th, 2013, 02:59 PM
Please edit your posted code to include line breaks, it's basically unreadable as-is. Copy & paste from notepad is one way to do this, where copy & paste from an html page often only has html breaks, which a textarea doesn't understand.
Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.