unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,URLMon, StdCtrls;
type
TForm1 =
class(TForm)
Memo1: TMemo;
Button2: TButton;
Memo2: TMemo;
Memo3: TMemo;
Button3: TButton;
Edit1: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
posi :integer;
implementation
{$R *.dfm}
function mail (text:char): boolean;
var test : integer;
begin
If ((ord(text) <=122)
and (ord(text) >=65))
or (ord(text) = 95)
or (ord(text) = 150)
or (ord(text) = 45)
then begin
result := true;
end else result := false;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
try
URLDownloadtofile(
nil, PChar(Edit1.Text), PChar('
c:\hp1.txt'), 0,
nil);
Memo1.Lines.LoadFromFile('
c:\hp1.txt') ;
Button2.click;
button3.Click;
DeleteFile('
C:\hp1.txt');
except
ShowMessage ('
Kann Quelltext der Seite nicht Downloaden');
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var zeile, buchstabe :
string;
i,f :integer;
begin
For f := 0
to Memo1.lines.count -1
do begin
zeile := Memo1.Lines[f];
For i := 1
to length(Zeile)
do begin
buchstabe := Zeile[i];
If buchstabe = '
@'
then begin
Memo2.lines.add (zeile);
end;
end;
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
var i,f,x,a,e,y :integer;
Zeile, buchstabe, anfang, ende, wort :
string;
begin
a := 0;
e := 0;
For f := 0
to Memo2.lines.count -1
do begin
zeile := Memo2.lines[f];
For i := 1
to Length(zeile)
do begin
buchstabe := zeile[i];
If buchstabe = '
@'
then begin
a := i;
e := i;
While (anfang = '
>')
or (anfang='
:')
do begin
a := a -1;
anfang := zeile[a];
end;
While ende = '
<'
do begin
inc(e);
ende := zeile[e];
end;
For y := a +3
to e -1
do begin
wort := wort + zeile[y];
end;
Memo3.lines.add (wort);
wort := '
';
anfang := '
';
ende := '
';
end;
end;
end;
end;