
08.12.2010, 23:39
|
Начинающий
|
|
Регистрация: 10.05.2010
Сообщения: 160
Репутация: 14
|
|
Код:
function SetTimeOutJS(Str: String): Integer;//ищет время на странице
var
I: Integer;
S: String;
begin
S := '")'',';
I := Pos(S, Str);
if I > 0 then
begin
S := Copy(Str, I + Length(S), Length(Str));
I := Pos(')', S);
if I > 0 then
begin
S := Trim(Copy(S, 1, I - 1));
I := StrToIntDef(S, -1);
if I > 0 then
Result := I
else
Result := 0;
end;
end;
end;
procedure BOT.Execute;
var
N: String;
h: Integer;
D: Integer;
Otvet: String;
Otvet1: String;
g1: String;
begin
Otvet := HTTP_BOT.get('http://' + Сайт + N);
Ur := парсит(Otvet);
Otvet1 := HTTP_BOT.get('http://' + Сайт + Ur);
h := SetTimeOutJS(Otvet1);
///
HTTP_BOT.get('Сайт');
Sleep(h);// h может быть от 10 секунд до ...
HTTP_BOT.get('http://' + Сайт + g1);
end;
|