#include #include #include #include $oIE = _IEAttach("Bing") $oEvt = ObjEvent($oIE, "IEEvent_", "DWebBrowserEvents2") Global $i Global $v = 0 Global $save = "link.txt";~ luu ket qua thanh file gi tuy cau Global $keylist = "keynew.txt" ;~ key muons search, cau dat ten gi cung duoc5 ChangeKey() While 1 $next = _IELinkClickByText($oIE, "Next") If $next <> -1 Then ChangeKey() WEnd Func IEEvent_BeforeNavigate2($notsurewhatthisis, $url, $TargetFrameName, $PostData, $Headers, $Cancel) If $url = $i Then ChangeKey() Else _IELoadWait($oIE) $oLinks = _IELinkGetCollection($oIE) For $oLink In $oLinks If Not StringInStr($oLink.href, "bing.com") And Not StringInStr($oLink.href, "productinfo.php?id=") And Not StringInStr($oLink.href, "&cPath=") And Not StringInStr($oLink.href, ".php?cPath=") And Not StringInStr($oLink.href, "/index.php?threads") And Not StringInStr($oLink.href, "/news/article.php?") And Not StringInStr($oLink.href, "/article.php?article") And Not StringInStr($oLink.href, "/article.php?") And Not StringInStr($oLink.href, "wiki.") And Not StringInStr($oLink.href, "/xcart/") And Not StringInStr($oLink.href, "/company.php?company=") And Not StringInStr($oLink.href, ".sch.uk") And Not StringInStr($oLink.href, "wikipedia.org") And Not StringInStr($oLink.href, "/wiki/") And Not StringInStr($oLink.href, "urbandictionary.com") And Not StringInStr($oLink.href, ".edu") And Not StringInStr($oLink.href, "mysql.com") And Not StringInStr($oLink.href, "live.com") And Not StringInStr($oLink.href, "google") And Not StringInStr($oLink.href, ".gov") And Not StringInStr($oLink.href, ".ac.uk") And Not StringInStr($oLink.href, "nhs.uk") And Not StringInStr($oLink.href, "microsoft.com") And Not StringInStr($oLink.href, "msn.com") And Not StringInStr($oLink.href, "facebook.com") And Not StringInStr($oLink.href, "/forum/") And Not StringInStr($oLink.href, "forum.") And Not StringInStr($oLink.href, "/forums/") And Not StringInStr($oLink.href, "forums.") And Not StringInStr($oLink.href, "microsofttranslator.com") And Not StringInStr($oLink.href, "/showthread.php?") And Not StringInStr($oLink.href, "/viewtopic.php?") And Not StringInStr($oLink.href, "/index.php?forums/") And Not StringInStr($oLink.href, "php?option=com_content") And Not StringInStr($oLink.href, "/index.php?topic") And Not StringInStr($oLink.href, "index.php?route= ") And Not StringInStr($oLink.href, "/index.php?forum/") And Not StringInStr($oLink.href, "cache.aspx?q=") Then ;~ $chars = FileRead("links2.txt") $l = _StringBetween($oLink.href, "http://", "/") If Not @error Then ;~ If Not StringInStr($chars, $l[0]) Then ;~ neu cau muon php? thi cau chi viec thay thanh php? If StringInStr($oLink.href, ".") Then If CheckString($save, $l[0]) = 0 Then FileWrite("links.txt", '"' & $oLink.href & '"' & @CRLF) EndIf EndIf ;~ EndIf EndIf EndIf Next $i = $url EndIf EndFunc ;==>IEEvent_BeforeNavigate2 Func CheckString($file, $string) $fsize = FileGetSize($file) $handle = _WinAPI_CreateFile($file, 2, 2, 2) $buffer = DllStructCreate("char[" & $fsize + 1 & "]") DllStructSetData($buffer, 1, Chr(0), $fsize + 1) Local $red _WinAPI_ReadFile($handle, DllStructGetPtr($buffer), $fsize, $red) _WinAPI_CloseHandle($handle) $call = DllCall("msvcrt.dll", "ptr:cdecl", "strstr", "ptr", DllStructGetPtr($buffer), "str", $string) If $call[0] Then Return 1 Else Return 0 EndIf $buffer = 0 EndFunc ;==>CheckString Func ChangeKey() FileDelete(RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "Cache") & "\*.*") $oForm = _IEFormGetObjByName($oIE, "sb_form") $oText = _IEFormElementGetObjByName($oForm, "q") $v = $v + 1 $k = FileReadLine("keynew.txt", $v) If @error Then MsgBox(0, 'Done!', 'Done!') _IEFormElementSetValue($oText, "language:en -site:youtube.com -site:.gov -site:wikipedia.org -site:facebook.com -site:google.com -site:edu -site:bing.com " & $k );~ thay ca cho nay nua _IEFormSubmit($oForm) EndFunc ;==>ChangeKey