it got mad at me for violating the rules. (some stuff about no bot searches).
so i made this.
it return the first 10 (unless you specified diff @ google) links about the search param's
ex usage $array = _Google('autoitscript')
$array[0] = number of links.
$array[1-10] = links.
Func _Google($s_q)<br /> <br /> ;locals<br /> Local $s_temp, $s_IE, $o_IE, $as_ret = ''<br /> <br /> $o_IE = ObjCreate ("InternetExplorer.Application")<br /> $o_IE.Navigate ('http://www.google.com/search?q=' & $s_q)<br /> While $o_IE.busy<br /> Sleep(10)<br /> WEnd<br /> $s_IE = $o_IE.document.body.innerHTML<br /> $s_IE = StringRegExp($s_IE, "<A(.*?)>", 3)<br /> <br /> For $i_count = 0 To UBound($s_IE) - 1<br /> $s_temp = StringLeft($s_IE[$i_count], StringInStr($s_IE[$i_count], '"', 0, -1) - 1)<br /> $s_temp = StringReplace(StringTrimLeft($s_temp, StringInStr($s_temp, '"', 0, -1)), '&', '&')<br /> If StringLeft($s_temp, 1) = '/' Or StringInStr($s_temp, 'google') Or StringInStr($s_temp, 'cache') Then ContinueLoop<br /> <br /> $as_ret &= $s_temp & '&*|&%'<br /> <br /> Next<br /> <br /> $as_ret = StringTrimRight($as_ret, 5)<br /> <br /> $as_ret = StringSplit($as_ret, '&*|&%', 1)<br /> <br /> Return $as_ret<br /> <br /> EndFunc ;==>_Google
Edited by w0uter, 19 August 2005 - 11:16 PM.




