Run("C:\Program Files\Opera1001\opera.exe")
WinWaitActive("Экспресс-панель - Opera")
Send("vkontakte.ru")
Send("{ENTER}")
Sleep(3000);пауза
Send("^{ENTER}");авторизация
Run("C:\Program Files\Opera1001\opera.exe")
WinWaitActive("Экспресс-панель - Opera")
Send("vkontakte.ru")
Send("{ENTER}")
Sleep(3000);пауза
Send("{TAB}")
Send("логин")
Send("{TAB}")
Send("пароль")
Send("{TAB}")
Send("{TAB}")
Send("{ENTER}")
$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
$oHTTP.Open("POST", 'http://zalil.ru/upload/')
$oHTTP.setTimeouts(5000, 5000, 15000, 15000)
$oHTTP.SetRequestHeader("Accept", "application/msword, image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*")
$oHTTP.SetRequestHeader("Referer", "http://zalil.ru/")
$oHTTP.SetRequestHeader("Proxy-Connection", "Keep-alive")
$oHTTP.SetRequestHeader("Accept-Language", "ru")
$oHTTP.SetRequestHeader("Content-Type", "multipart/form-data; boundary="&$boundary)
$oHTTP.SetRequestHeader("Proxy-Connection", "Keep-Alive")
$oHTTP.SetRequestHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)")
$Login = "[email protected]" ; Ваш логин
$Pass = "qwerty" ;Ваш пароль
ShellExecute("http://vkontakte.ru/login.php?m=1&email="&$Login&"&pass="&$Pass) ;вход на сайт
#include <IE.au3>
Opt('MustDeclareVars', 1)
Opt('TrayIconDebug', 1)
HotKeySet('{ESC}', '_Exit')
_VK_Login('e-mail', 'password')
If @error Then MsgBox(16, 'Авторизация', 'Ошибка авторизации: ' & @TAB & @error & @CRLF & 'Ошибка функции: ' & @TAB & @TAB & @extended)
Func _VK_Login($sEmail, $sPass, $iHide=1)
Local $oIE, $oLoginForm, $oEmail, $oPass
$oIE = _IECreate('http://vkontakte.ru', 0, 0)
If @error Then
SetError(1, @error)
Return 0
EndIf
$oLoginForm = _IEFormGetObjByName($oIE, 'login')
If @error Then
SetError(2, @error)
Return 0
EndIf
$oEmail = _IEFormElementGetObjByName($oLoginForm, 'email')
If @error Then
SetError(3, @error)
Return 0
EndIf
$oPass = _IEFormElementGetObjByName($oLoginForm, 'pass')
If @error Then
SetError(4, @error)
Return 0
EndIf
_IEFormElementSetValue($oEmail, $sEmail)
If @error Then
SetError(5, @error)
Return 0
EndIf
_IEFormElementSetValue($oPass, $sPass)
If @error Then
SetError(6, @error)
Return 0
EndIf
_IEFormSubmit($oLoginForm)
If @error Then
SetError(5, @error)
Return 0
EndIf
If $iHide Then _IEAction($oIE, 'visible')
If @error Then
SetError(6, @error)
Return 0
EndIf
SetError(0, 0)
Return 1
EndFunc
Func _Exit()
Exit
EndFunc
Global $oWinHttpError, $iEventError = 0, _
$sEmail = 'Ваш e-mail', _
$sPass = 'Пароль', _
$sText, $sFile = @ScriptDir & '\UserProfile.txt', $hFile
$oWinHttpError = ObjEvent('AutoIt.Error', '_WinHttpErrorHandler')
$sText = _GetUserProfile_VK($sEmail, $sPass)
If @error Then
MsgBox(16, 'Error', @error)
Exit
Else
$hFile = FileOpen($sFile, 2)
FileWrite($hFile, $sText)
FileClose($hFile)
MsgBox(64, 'OK', 'OK')
Exit
EndIf
Func _GetUserProfile_VK($sEmailUser, $sPassUser)
Local $oHTTP, $sCookie_1, $sCookie_2, $sCookie, $sHeader, $sHtmlProfile
$oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
$oHTTP.Open('POST', 'http://login.vk.com/?act=login')
$oHTTP.setTimeouts(5000, 5000, 15000, 15000)
$oHTTP.SetRequestHeader('Accept-Language', 'ru')
$oHTTP.SetRequestHeader('Referer', 'http://vkontakte.ru')
$oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
$oHTTP.SetRequestHeader('User-Agent', 'AutoIt')
$oHTTP.SetRequestHeader('Host', 'login.vk.com')
$oHTTP.SetRequestHeader('Proxy-Connection', 'Keep-alive')
$oHTTP.Send('act=login&q=1&al_frame=1&expire=&captcha_sid=&captcha_key=&from_host=vkontakte.ru&email=' & $sEmailUser & '&pass=' & $sPassUser)
If $iEventError Then
Return SetError($iEventError)
EndIf
$oHTTP.WaitForResponse
$sHeader = $oHTTP.GetAllResponseHeaders
If Not $sHeader Then
Return SetError(1)
EndIf
$sCookie_1 = StringRegExpReplace($sHeader, '(?s).*?Set-Cookie: (remixchk=\d;\s)\w?.*', '\1')
If @extended <> 1 Then
Return SetError(1)
EndIf
$sCookie_2 = StringRegExpReplace($sHeader, '(?s).*?Set-Cookie: (remixsid=.*?);\s\w?.*', '\1')
If @extended <> 1 Then
Return SetError(1)
EndIf
$sCookie = $sCookie_1 & $sCookie_2
If Not $sCookie Then
Return SetError(1)
EndIf
$oHTTP.Open('POST', 'http://vkontakte.ru/profile.php')
$oHTTP.SetRequestHeader('Cookie', $sCookie)
$oHTTP.setTimeouts(5000, 5000, 15000, 15000)
$oHTTP.SetRequestHeader('Accept-Language', 'ru')
$oHTTP.SetRequestHeader('Referer', 'http://login.vk.com/?act=login')
$oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
$oHTTP.SetRequestHeader('User-Agent', 'AutoIt')
$oHTTP.SetRequestHeader('Host', 'vkontakte.ru')
$oHTTP.SetRequestHeader('Proxy-Connection', 'Keep-alive')
$oHTTP.Send('')
If $iEventError Then
Return SetError($iEventError)
EndIf
$oHTTP.WaitForResponse
$sHtmlProfile = $oHTTP.ResponseText
If Not $sHtmlProfile Then
Return SetError(1)
EndIf
Return SetError(0, 0, $sHtmlProfile)
EndFunc ;==>_GetUserProfile_VK
Func _WinHttpErrorHandler()
$iEventError = $oWinHttpError.Number
EndFunc ;==>_WinHttpErrorHandler