Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Unit2;
- interface
- uses
- Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
- Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.OleCtrls, SHDocVw,
- Vcl.ExtCtrls, Soap.InvokeRegistry, IdBaseComponent, IdComponent,
- IdTCPConnection, IdTCPClient, IdHTTP, Soap.Rio, Soap.SOAPHTTPClient;
- type
- TForm2 = class(TForm)
- Button1: TButton;
- Edit1: TEdit;
- Panel1: TPanel;
- OpenDialog1: TOpenDialog;
- Memo1: TMemo;
- Button2: TButton;
- Memo2: TMemo;
- WebBrowser1: TWebBrowser;
- ListBox1: TListBox;
- CheckBox1: TCheckBox;
- CheckBox2: TCheckBox;
- procedure Button1Click(Sender: TObject);
- procedure Edit1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- private public end;
- var Form2: TForm2; a,b,c,j:string; e:textfile;
- implementation {$R *.dfm}
- procedure TForm2.Button1Click(Sender: TObject);var i,h:integer; begin
- a:=Edit1.Text; b:='';
- for i:=1 to length(a) do begin
- if a[i]='.' then
- h:=i-1;
- end;
- for i:=1 to h do
- b:=b+a[i];
- b:=b+'.json';
- WebBrowser1.Navigate(b);
- end;
- procedure TForm2.Button2Click(Sender: TObject); var str:string; tsl:TStringList; i,k,posI,g,oo:integer;
- lin,endl:string; formats:boolean; begin
- Memo2.Clear;
- OpenDialog1.Execute();
- AssignFile(e, OpenDialog1.FileName); Reset(e);
- Memo1.lines.LoadFromFile(OpenDialog1.FileName); CloseFile(e);
- str:='path'; tsl:=TStringList.Create;
- tsl.DelimitedText:=Memo1.Text;
- k:=0;
- Memo2.Lines.Add('<html><head><title>2ch</title></head><style>');
- Memo2.Lines.Add('* {font-family: verdana; color: #000; Verdana; padding: 0; margin: 0; overflow-x:hidden;}');
- Memo2.Lines.Add('a {color: #fff; text-decoration: none; border-radius: 5px; background-color: #55cc62;}');
- Memo2.Lines.Add('#content {margin: 48px auto 10px; min-width: 100px; max-width: 600px;}');
- Memo2.Lines.Add('img {margin: 10px auto 10px; min-width: 100px; max-width: 600px;}');
- Memo2.Lines.Add('video {margin: 10px auto 10px; min-width: 100px; max-width: 600px;}');
- Memo2.Lines.Add('#inform {position: fixed; margin: 0 0 10px;padding: 20px;background-color: #e8e8e8; width: 100%;');
- Memo2.Lines.Add('</style><body><div id="inform"><center>@Вот что нам удалось найти:</div><div id="content"><center>');
- for i:=1 to tsl.Count-1 do begin
- if tsl[i]=str then begin
- inc(k); posI:=1;
- end;
- if (posI=1) then begin
- if tsl[i]<>str then begin
- ListBox1.items.add(tsl[i]); posI:=0;
- ListBox1.ItemIndex:=ListBox1.Items.Count-1;
- end;
- end;
- end;
- for i:=0 to ListBox1.Items.Count-1 do begin
- lin:=(ListBox1.Items[i]);
- endl:='';
- for g:=3 to length(lin)-1 do begin
- endl:=endl+(lin[g]);
- end;
- for oo:=0 to length(endl) do begin
- if endl[oo]='w' then formats:=true;
- end;
- if formats=true then if CheckBox1.Checked=true then Memo2.Lines.Add('<div><video id="movies" onmouseover="this.play()" onmouseout="this.pause()" loop="" controls=""><source src="https://2ch.hk'+endl+'" type="video/webm"></video><br>.webm <a href="https://2ch.hk'+endl+'">оригинал</a></div>');
- if formats=false then if CheckBox2.Checked=true then Memo2.Lines.Add('<div><img src="https://2ch.hk'+endl+'"><br>.img <a href="https://2ch.hk'+endl+'">оригинал</a></div>');
- formats:=false;
- end;
- Memo2.Lines.Add('</center></div></body></html>');
- Memo2.Lines.SaveToFile(OpenDialog1.FileName+'.html');
- end;
- procedure TForm2.Edit1Click(Sender: TObject); begin
- Edit1.SelectAll; end;
- procedure TForm2.FormCreate(Sender: TObject);
- begin
- Application.Title:='2chContent PARSER';
- ShowMessage('https://gigeu.url.ph');
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement