Article View: news.software.readers
Article #139605Re: Default posting server for Dialog
From: MLC
Date: Sat, 20 Dec 2003 11:53
Date: Sat, 20 Dec 2003 11:53
153 lines
5336 bytes
5336 bytes
Il 20/dic/2003 Jeff Relf ha scritto:
> I'd love a copy of that script ,
> if you would be so kind .
Gladly.
Here it is:
Program GoToParent;
uses
Forms,
StdCtrls;
var
myForm: TForm;
myMemo: TMemo;
Refs: string;
ParentID: string;
FUNCTION EmptyClipboard:boolean; external 'EmptyClipboard@user32.dll
stdcall';
FUNCTION OpenClipboard(hWndNewOwner: INTEGER):boolean; external
'OpenClipboard@user32.dll stdcall';
FUNCTION CloseClipboard:boolean; external 'CloseClipboard@user32.dll
stdcall';
PROCEDURE ClearCLipboard;
BEGIN
OpenClipboard(0);
EmptyClipboard;
CloseClipboard;
END;
PROCEDURE GetMessageBody (var LocMymemo: tMemo);
BEGIN
LocMyMemo.Clear;
ClearCLipboard;
ADo('ArticlePane');
ADo('SelectAll');
Ado('Copy');
LocMyMemo.PasteFromClipboard;
END;
FUNCTION RefsExtract( HeaderTag: String; var LocMymemo: tmemo): string;
var
index : integer;
allrefs: string;
BEGIN
index := 0;
allrefs := '';
WHILE (index < LocMymemo.Lines.count-1) AND (allrefs = '') DO
BEGIN
IF POS(HeaderTag,LocMymemo.lines.Strings[index]) = 1 THEN
BEGIN
allrefs := LocMymemo.lines.Strings[index];
index := index+1;
WHILE (index < LocMymemo.Lines.count-1)
AND (POS('<',LocMymemo.lines.Strings[index])=1) DO
BEGIN
allrefs := allrefs + LocMymemo.lines.Strings[index];
index := index+1;
END
END
index := index+1;
END;
result:=allrefs;
END;
FUNCTION GetHeaderInfo(HeaderTag : string; var LocMymemo : tMemo):
string;
BEGIN
Result := RefsExtract(HeaderTag, LocMymemo);
delete(Result, 1, length(HeaderTag));
END;
FUNCTION GetRefs(var LocMymemo : tMemo): string;
begin
result := GetHeaderInfo('References: ', LocMymemo);
end;
FUNCTION GetParent(var LocRefs: string): string;
var
tag: string;
index: integer;
posiz, lung : integer;
begin
tag := '<';
index := length(LocRefs)-1;
result := '';
posiz := 0;
while (index > 0) and (posiz = 0) do
begin
if Pos(tag, LocRefs[index])=0 then
index:=index-1
else
posiz := index;
lung:=length(LocRefs)-posiz+1;
result := copy(LocRefs, posiz, lung);
end
end;
FUNCTION AreHeadersHidden(var LocMymemo : tMemo): boolean;
var
index: integer;
temp: boolean;
BEGIN
temp := true;
IF LocMyMemo.Lines.count > 10 THEN
BEGIN
index := 0;
WHILE (Index < LocMyMemo.Lines.count -1) and temp DO
BEGIN
index := index+1;
temp := Pos('Newsgroups: ', LocMyMemo.Lines.strings[index]) =
0;
END;
END;
result := temp;
END;
Begin
myForm := tForm.Create(nil);
myForm.width:=800;
myForm.Height:=600;
myMemo := tMemo.Create(myForm);
myMemo.Parent := myForm;
myMemo.Width := myForm.width;
myMemo.Height := myForm.Height;
try
GetMessageBody(myMemo);
if AreHeadersHidden(myMemo) then
ADo('ShowHeaders');
GetMessageBody(myMemo);
Refs := GetRefs(myMemo);
myMemo.Clear;
myMemo.Lines.Add(Refs);
ParentID := GetParent(Refs);
ClearClipboard;
myMemo.Clear;
myMemo.Lines.Add(ParentID);
myMemo.SelectAll;
myMemo.CopyToClipboard;
if AreHeadersHidden(myMemo) then
ADo('ShowHeaders');
finally
myform.free;
Ado('FindMessageID');
end;
End.
--
Maria Luisa C - 20/12/2003 12.49.23, here.
http://fido.altervista.org/
Technical Details
Message-ID:
<aj9lr4xoxolz.dlg@ID-187316.user.uni-berlin.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!border1.nntp.ash.giganews.com!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!news2.euro.net!newsfeed.vmunix.org!fu-berlin.de!uni-berlin.de!ppp-25-199.26-151.libero.IT!not-for-mailReferences:
<15206tgjyhq1h.17dmif0bvs4d0$.dlg@40tude.net> <17ll05gsjz7a7.dlg@ID-187316.user.uni-berlin.de> <rti9xxjetvm2$.dlg@__.Jeff.Relf> <4tw63tyuyrwu.dlg@ID-187316.user.uni-berlin.de> <7jv2qokuxvov.dlg@__.Jeff.Relf> <1m94fm1vlkaa7.dlg@ID-187316.user.uni-berlin.de> <1dbz6gywlk4sv$.dlg@__.Jeff.Relf>Show Full Headers
Complete Article Headers
Message-ID: <aj9lr4xoxolz.dlg@ID-187316.user.uni-berlin.de>
Subject: Re: Default posting server for Dialog
Date: Sat, 20 Dec 2003 12:53:39 +0100
From: MLC <maluc52@yahoo.it>
References: <15206tgjyhq1h.17dmif0bvs4d0$.dlg@40tude.net> <17ll05gsjz7a7.dlg@ID-187316.user.uni-berlin.de> <rti9xxjetvm2$.dlg@__.Jeff.Relf> <4tw63tyuyrwu.dlg@ID-187316.user.uni-berlin.de> <7jv2qokuxvov.dlg@__.Jeff.Relf> <1m94fm1vlkaa7.dlg@ID-187316.user.uni-berlin.de> <1dbz6gywlk4sv$.dlg@__.Jeff.Relf>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!border1.nntp.ash.giganews.com!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!news2.euro.net!newsfeed.vmunix.org!fu-berlin.de!uni-berlin.de!ppp-25-199.26-151.libero.IT!not-for-mail
Newsgroups: news.software.readers
Organization: none
Lines: 153
Reply-To: mlcald@msn.com
NNTP-Posting-Host: ppp-25-199.26-151.libero.it (151.26.199.25)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de 1071921223 8773054 151.26.199.25 ([187316])
User-Agent: 40tude_Dialog/2.0.8.1 (a90f2ca4.370.323)
X-Face: (O6iue.kQNT|`uU@vD|.WKC^TF~T<TIA,\;
B'27kz>*1Mk|Z6U!2EKSFc')'xVk]t'/3<,#
#L+5&I{L<!Q%p[k|+%mSCT"e2\4JnDJhbQ,`EA4fu$q0q>{7W?\gQeqD@*lzcR0~:9Zzn!1yCRb