Форум АНТИЧАТ

Форум АНТИЧАТ (https://forum.antichat.xyz/index.php)
-   С/С++, C#, Delphi, .NET, Asm (https://forum.antichat.xyz/forumdisplay.php?f=24)
-   -   Яндекс регер (https://forum.antichat.xyz/showthread.php?t=205672)

reger1992 21.05.2010 15:25

Яндекс регер
 
У кого нибудь есть пример авторегера Яндекс?
Я проснифирил, но почему то регистрация не проходит

Цитата:

procedure TForm2.Button1Click(Sender: TObject);
begin
request:=tstringlist.Create();
response:=tstringlist.Create();


request.text:=IDHTTP1.Get('http://passport.yandex.ru/passport?mode=register');
posl:=copy(request.Text,pos('ncrnd=',request.Text) +6,6);
id:=copy(request.Text,pos('idkey',request.Text)+14 ,22);
response.add('idkey='+id);
response.add('step=one');
response.add('filled=');
response.add('fresh=');
response.add('iname=вася');
response.add('fname=пупкин');
response.add('login='+edit1.text);
response.add('done=done');
request.text:=IDHTTP1.post('http://passport.yandex.ru passport?mode=register&ncrnd='+posl,response);
posl:=copy(request.Text,pos('ncrnd=',request.Text) +6,6);
id2:=copy(request.Text,pos('idkey',request.Text)+1 4,22);
showmessage(posl);
fs:=tfilestream.create('c:\1.gif',fmcreate);
idhttp2.get('http://passport.yandex.ru/digits?idkey='+id2,fs);
fs.Free;
image1.picture.LoadFromFile('c:\1.gif');
end;

procedure TForm2.Button2Click(Sender: TObject);
begin

response.Text:='';
response.add('idkey='+id);
response.add('step=two');
response.add('filled=');
response.add('login='+edit1.Text);
response.add('iname=вася);
response.add('fname=пупкин');
response.add('time=');
response.add('gmt_offset=');
response.add('passwd=123456');
response.add('passwd2=123456');
response.add('hintq=6');
response.add('udhintq=');
response.add('hinta=0123234243');
response.add('email=');
response.add('phonenumber=');
response.add('code='+edit2.text);
response.add('agreed=yes');
response.add('newform=');
request.text:=IDHTTP1.post('http://passport.yandex.ru/passport?mode=register&ncrnd='+posl,response);



end. end.

BlackSite 21.05.2010 15:38

+1 если у кого есть рабочий с меня +

eLWAux 21.05.2010 16:03

Цитата:

Сообщение от reger1992
Я проснифирил, но почему то регистрация не проходит

а что второй request.text возврашает?

reger1992 21.05.2010 16:09

200 ОК, хотя должен 302 выдавать.

M_script_ 22.05.2010 10:45

Шаг 1
Код:

sUrl =        "http://passport.yandex.ru/passport?mode=register&ncrnd=" +
                  sNcrnd; 
sRequest =        "idkey=" +
                          sIdKey +
                          "&step=one&filled=yes&fresh=1&iname=" +
                          MultibyteToUTF8(sFirstName) +
                          "&fname=" +
                          MultibyteToUTF8(sLastName) +
                          "&login=" +
                          sLogin +
                          "&done=%D0%94%D0%B0%D0%BB%D1%8C%D1%88%D0%B5+%E2%86%92";

Капча
Код:

sUrl =        "http://passport.yandex.ru/digits?idkey=" +
                sIdKey;

Шаг 2
Код:

sUrl =        "http://passport.yandex.ru/passport?mode=register&ncrnd=" +
                sNcrnd;
sRequest =        "idkey=" +
                        sIdKey +
                        "&step=two&filled=yes&login=" +
                        sLogin +
                        "&fname=" +
                        MultibyteToUTF8(sLastName) +
                        "&iname=" +
                        MultibyteToUTF8(sFirstName) +
                        "&time=&gmt_offset=&passwd=" +
                        sPass +
                        "&passwd2=" +
                        sPass +
                        "&hintq=6&udhintq=&hinta=" +
                        sPassportNum +
                        "&email=&phonenumber=&code=" +
                        sCaptcha +
                        "&agreed=yes&newform=%D0%97%D0%B0%D1%80%D0%B5%D0%B3%D0%B8%D1%81%D1%82%D1%80%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D1%82%D1%8C";

Проверка ответа после шага 2
Код:

if(        sPage.Pos("302") &&
        sPage.Pos("Location: http://passport-ckicheck.yandex.ru/passport?mode=ckicheck&step=three") &&
        sPage.Pos("Location: http://pass.yandex.ru/login?retpath=") &&
        sPage.Pos("Location: http://passport.yandex.ru/passport?mode=welcome") &&
        sPage.Pos("200 OK"))
{
        // good
}
else
{
        // bad
}

BlackSite, реггер - http://mscript.biz/soft/yandex_ar.rar
библиотеки - http://mscript.biz/soft/libcurl.rar

reger1992 22.05.2010 10:51

упс спасибо, ща попробую)

M_script_ 22.05.2010 10:54

Цитата:

Сообщение от reger1992
упс спасибо, ща попробую)

Похоже, что у тебя проблема из-за кодировки, нужно отправлять в UTF8

reger1992 22.05.2010 11:04

Да, я уже понял) Сейчас попробую переписать)


Время: 07:15