🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
63 messages
63 total messages Page 2 of 2 Started by Sqwertz Wed, 20 Feb 2008 22:07
Page 2 of 2 • 63 total messages
Re: [Dialog] I need two X-No-Archive Headers
#217231
Author: Black Dragon
Date: Sat, 23 Feb 2008 13:13
12 lines
1130 bytes
Dan C wrote:

> "Ubuntu" -- an African word, meaning "Slackware is too hard for me".

"Linux" -- an English word, meaning "BSD is too hard for me".

HTH

-- 
Black Dragon                                     http://improve-usenet.org

Watch out for a cold wave this week.  (Or maybe a warm WAC.)
Re: [Dialog] I need two X-No-Archive Headers
#217227
Author: MikeV06
Date: Sat, 23 Feb 2008 18:27
27 lines
1898 bytes
On Sat, 23 Feb 2008 12:17:40 -0600, MikeV06 wrote:

> This indeed is much cleaner. I will be curious to see what this looks like
> after it is posted.
> 
> Does a way exist to test this without actually sending it?
> 
> Do you know what is the purpose of the Archive: header?
> 
> Thank you for the suggestions. We will see what happens now!
> 
> Mike

Only the first call got inserted.

Message-ID: <o99j9yxj2h8y.dlg@mycomputer06.invalid>
Archive: No
X-No-Archive: Yes
Lines: 65

Neither of these calls made it in.

   // This calls the add XNA: banter procedure
   AddAnyHeader ('X-No-Archive: banter', Message, IsEmail);
   AddAnyHeader ('X-ScriptMadeBy: s de man', Message, IsEmail);
   //
Re: [Dialog] I need two X-No-Archive Headers
#217229
Author: MikeV06
Date: Sat, 23 Feb 2008 18:54
35 lines
2102 bytes
On Sat, 23 Feb 2008 12:39:09 -0600, MikeV06 wrote:

> On Sat, 23 Feb 2008 12:27:13 -0600, MikeV06 wrote:
>> 
>> Only the first call got inserted.
>> 
>> Message-ID: <o99j9yxj2h8y.dlg@mycomputer06.invalid>
>> Archive: No
>> X-No-Archive: Yes
>> Lines: 65
>> 
>> Neither of these calls made it in.
>> 
>>    // This calls the add XNA: banter procedure
>>    AddAnyHeader ('X-No-Archive: banter', Message, IsEmail);
>>    AddAnyHeader ('X-ScriptMadeBy: s de man', Message, IsEmail);
>>    //
> 
> I need to see if the call to box_quotes is still working:
> 
> box:
> Boxquote example
> -
>    if Message.count < 500 then BoxQuote( Message );
> -

box_o:
Examplefails
-
None of the insert calls seem to be working?
-

Drat.

Re: [Dialog] I need two X-No-Archive Headers
#217232
Author: MikeV06
Date: Sat, 23 Feb 2008 19:28
290 lines
9210 bytes
On Fri, 22 Feb 2008 20:34:56 GMT, Sqwertz wrote:

> See the script I just posted for an example.  
> 
> The OnBeforeSendingMessage() function will call two (or more)
> procedures and return True.
> 
> Then again, my script doesn't work, so YMMV ;-)

Uhm, none of my calls are working?

Here is the program

program OnBeforeSendingMessage;

   {$I Include_AddAnyHeader.ds}   
   {$I Insert_Boxquotes.ds}   
  
function OnBeforeSendingMessage(
   var   Message    : TStringlist;
   const Servername : String;
   const IsEmail    : Boolean
) : Boolean;

begin
   //
   // if result is set to false, sending messages will *always* fail;
   // use this for debugging along with the messagebox.
   //
   result := true;
   //
   // This calls the add XNA: banter procedure
   AddAnyHeader ('X-No-Archive: banter', Message, IsEmail);
   AddAnyHeader ('X-ScriptMadeBy: s de man', Message, IsEmail);
   //
   if Message.count < 500 then BoxQuote( Message );
end;  // function OnBeforeSendingMessage()

BEGIN
end.  

Here is one of the scripts being called

// 
procedure AddAnyHeader(AddHeader:String; var Message:TStringlist;
IsEmail:Boolean);
var i: integer;
begin
   If not IsEmail then begin
      i := 1;
      while Message[i] <> '' do 
            i := i+1;
      Message.insert(i, AddHeader);
   end;
end;

Here is the other (boxquotes use to work before this change ...)
//Program Insert_Boxquotes;
//script to automagically insert Boxquotes into a message before being sent
//you will not see the result inside the editor-window but only in the
transmitted article
//box: or box_o:
//Example
//-
//aslkdjl aksdj lkajsd lkjalsdkj lakj sadalksjd lkjasldkj lakjd
//- 

const
   //
   // configure your settings here:
   //
   StartLine_close_box = 'box:';
   StartLine_open_box = 'box_o:';
   Separator = '-';


   // --------------------------------------------------------------- //
   // ----  No user maintainable parts below this line -------------- //
   // --------------------------------------------------------------- //

   MaxInt = 2147483647;

   bq1a = ',';
   bq1b = '-';
   bq1c = '.';
   bq2a = '|';
   bq2c = '|';
   bq3a = ''+#39+'';
   bq3b = '-';
   bq3c = ''+#39+'';

   LineWidthTop    = 4;
   LineWidthBottom = 4;

   s_no_bq = 0;
   s_bq_title = 1;
   s_bq_content = 2;


//
// program BoxQuote   -   Date: 2004/11/05
//
function StringReplaceM(
   S          : String;
   OldPattern : String;
   NewPattern : String;
   replaceall : Boolean;
   ignorecase : Boolean
) : String;

var
   SearchStr : String;
   Patt      : String;
   NewStr    : String;
   Offset    : Integer;

begin
   if IgnoreCase then begin
      SearchStr := AnsiUpperCase( S );
      Patt := AnsiUpperCase( OldPattern );
   end
   else begin
      SearchStr := S;
      Patt := OldPattern;
   end;
   NewStr := S;
   Result := '';
   while SearchStr <> '' do begin
      Offset := AnsiPos(Patt, SearchStr);
      if Offset = 0 then begin
         result := result + NewStr;
         break;
      end;
      result := result + Copy( NewStr, 1, Offset - 1 ) + NewPattern;
      NewStr := Copy( NewStr, Offset + Length(OldPattern), MaxInt );
      if not ReplaceAll then begin
         Result := Result + NewStr;
         break;
      end;
      SearchStr := Copy( SearchStr, Offset + Length(Patt), MaxInt );
   end;
end;  // function StringReplaceM()


function RepeatChar(
   c     : Char;
   count : Integer
) : String;

var
   i : Integer;
   
begin
   if count < 0 then count := 0;
   SetLength( result, count );
   for i:=1 to count do result[i] := c;
end;  // function RepeatChar()


function CountChars(
   s : String;
   c : Char
) : Integer;

var
   i : Integer;

begin
   result := 0;
   for i := 1 to Length( s ) do if s[i] = c then result := result + 1;
end;  // function CountChars()


procedure BoxQuote(
   var Message : TStringlist
);

var
   i, j, k      : Integer;
   state        : Word;
   bq_startline : Integer;
   bq_title     : String;
   bq_content   : String;
   maxwidth     : Integer;
   sl           : Tstringlist;
   CloseBox     : Boolean;
    
begin
   state := s_no_bq;
   i := 0;
   bq_startline := -1;
   while i <= message.count-1 do begin
      case state of
         s_no_bq: begin
            if    (message.strings[i] = StartLine_close_box)
               or (message.strings[i] = StartLine_open_box)
            then begin
               if message.strings[i] = StartLine_close_box
                  then CloseBox := true
                  else CloseBox := false;
               bq_startline := i;
               bq_title     := '';
               bq_content   := '';
               maxwidth     := 1;
               state        := s_bq_title;
            end
         end;
         s_bq_title: begin
            if message.strings[i] = Separator
               then state := s_bq_content
               else bq_title := trim( bq_title + ' ' + message.strings[i]
);
         end;
         s_bq_content: begin
            if message.strings[i]=Separator then begin
               state:=s_no_bq;
               if Length( '[' + bq_title + ']' ) > maxwidth
                  then maxwidth := Length( '[' + bq_title + ']' ) + 6;
               //
               // delete the raw BoxQuote
               //
               for j := bq_startline to i do message.delete( bq_startline
);
               //
               // middle part
               //
               bq_content := stringreplacem( #13#10 + bq_content,
                                             #13#10, #13#10 + bq2a + ' ',
                                             true, false );
               delete( bq_content, 1, 2 );
               //
               // first line
               //
               if bq_title <> ''
                  then bq_content := bq1a
                                     + RepeatChar( bq1b, LineWidthTop )
                                     + ' [' + bq_title + '] '
                                     + #13#10
                                     + bq_content
                  else bq_content := bq1a
                                     + RepeatChar( bq1b, LineWidthTop )
                                     + #13#10
                                     + bq_content;
               //
               // last line
               //
               bq_content := bq_content + #13#10 + bq3a + RepeatChar( bq3b,
LineWidthBottom );
               sl := Tstringlist.create;
               try
                  sl.text := bq_content;
                  //
                  // close the box
                  //
                  if CloseBox then begin
                     for j:=0 to sl.count-1 do begin
                        k := maxwidth - length( sl.strings[j] );
                        if j=0
                           then sl.strings[j] := sl.strings[j] +
repeatchar( bq1b,k + 3 ) + bq1c
                           else if j = sl.count-1
                              then sl.strings[j] := sl.strings[j] +
repeatchar( bq3b,k + 3 ) + bq3c
                              else sl.strings[j] := sl.strings[j] +
repeatchar(' ', k + 3) + bq2c;
                     end;
                  end;
                  message.insert( bq_startline, trim(sl.text) );
                  i := bq_startline;
               finally
                  sl.free;
               end;
            end
            else begin
               if bq_content = ''
                  then bq_content := message.strings[i]
                  else bq_content := bq_content + #13#10 +
message.strings[i];
               if Length( message.strings[i] ) > maxwidth
                  then maxwidth := length( message.strings[i] );
            end;
         end;
      end;  // case
      i := i + 1;
   end;
end;  // procedure BoxQuote()

Argg..

Re: [Dialog] I need two X-No-Archive Headers
#217233
Author: MikeV06
Date: Sat, 23 Feb 2008 19:37
12 lines
1600 bytes
Does a way to test the beforesending program exist without sending it to
the server? 

I posted my setup following your suggestion (I think) and now no insert
calls are working (addheader and boxquote).

I hate to keep sending messages as a means for testing.

Do you see anything obvious in the code I posted earlier?

Thanks.
Re: [Dialog] I need two X-No-Archive Headers
#217234
Author: MikeV06
Date: Sat, 23 Feb 2008 19:39
3 lines
1245 bytes
Dang it all, now it is working ????

Mike
Re: [Dialog] I need two X-No-Archive Headers
#217238
Author: Dan C
Date: Sun, 24 Feb 2008 02:58
17 lines
1844 bytes
On Sat, 23 Feb 2008 08:13:05 -0500, Black Dragon wrote:

>> "Ubuntu" -- an African word, meaning "Slackware is too hard for me".
 
> "Linux" -- an English word, meaning "BSD is too hard for me".

Bah.

BSD is no harder than Linux, which I assume you know is true.

What makes BSD not worth the effort is the hassle of getting useful
software to work.  The underlying OS is not difficult.


-- 
"Ubuntu" -- an African word, meaning "Slackware is too hard for me".
Re: [Dialog] I need two X-No-Archive Headers
#217239
Author: Oliver Cromm
Date: Sun, 24 Feb 2008 03:54
23 lines
2343 bytes
* MikeV06 wrote:

> Does a way to test the beforesending program exist without sending it to
> the server? 

I'm afraid not. I use a local server (Hamster) to test it, so it doesn't
go to the world.

> I posted my setup following your suggestion (I think) and now no insert
> calls are working (addheader and boxquote).
> 
> I hate to keep sending messages as a means for testing.

You should send test messages to a test group. Any newsgroup whose name
ends in .test
 
> Do you see anything obvious in the code I posted earlier?

No. Did you compile the OnBeforeSendingMessage script? Did you try
"reload scripts"?

-- 
Oliver C.
Re: [Dialog] I need two X-No-Archive Headers
#217240
Author: Black Dragon
Date: Sun, 24 Feb 2008 04:17
33 lines
1896 bytes
Dan C wrote:

> On Sat, 23 Feb 2008 08:13:05 -0500, Black Dragon wrote:

>>> "Ubuntu" -- an African word, meaning "Slackware is too hard for me".
 
>> "Linux" -- an English word, meaning "BSD is too hard for me".

> Bah.

> BSD is no harder than Linux, which I assume you know is true.

Indeed.

> What makes BSD not worth the effort is the hassle of getting useful
> software to work.  

Nonsense. BSD and Linux typically share most of the same OSS software, and 
I haven't had any trouble recently getting Linux binaries to run on (Free)
BSD with emulation. Your mileage may vary, but that's been my personal 
experience.

> The underlying OS is not difficult.

That is not nonsense. BSD is far better organized and documented than
Linux (as an OS of 100's of distros) could ever hope to be.

-- 
Black Dragon                                     http://improve-usenet.org

Opinions are like assholes -- everyone's got one, but nobody wants to
look at the other guy's.
		-- Hal Hickman
Re: [Dialog] I need two X-No-Archive Headers
#217242
Author: MikeV06
Date: Mon, 25 Feb 2008 13:24
63 lines
3467 bytes
On Sat, 23 Feb 2008 22:54:42 -0500, Oliver Cromm wrote:

> * MikeV06 wrote:
> 
>> Does a way to test the beforesending program exist without sending it to
>> the server? 
> 
> I'm afraid not. I use a local server (Hamster) to test it, so it doesn't
> go to the world.

I tried inserting a NNTP-Posting-Host which causes the ISP to reject the
message. That works except I have found out that what Dialog has in the
Sent folder is not what is transmitted. For example, the message I sent
about Boxquotes shows it failing when I look at the Sent folder, but when
the message is received via the list, it works. Interestingly enough,
however, the header adds do show up in the Sent folder message. 

This calls both

,---- [OnBeforeSending] 
| begin
|    //
|    // if result is set to false, sending messages will *always* fail;
|    // use this for debugging along with the messagebox.
|    //
|    result := true;
|    //
|    // This calls the add XNA: banter procedure
|    AddAnyHeader ('X-No-Archive: banter', Message, IsEmail);
|    AddAnyHeader ('X-Test: Box', Message, IsEmail);
|    //
|    if Message.count < 500 then BoxQuote( Message );
| end;  // function OnBeforeSendingMessage()
'----

The code should be set off.

I guess the other way would be to post to one of the test groups. But then
one has to wait for the turnaround. I did start using WriteToLog to get
some debugging output.
 
>> I posted my setup following your suggestion (I think) and now no insert
>> calls are working (addheader and boxquote).
>> 
>> I hate to keep sending messages as a means for testing.
> 
> You should send test messages to a test group. Any newsgroup whose name
> ends in .test

My thoughts above since forcing a posting failure at the ISP point does not
capture the results correctly in the Sent folder.

>> Do you see anything obvious in the code I posted earlier?
> 
> No. Did you compile the OnBeforeSendingMessage script? Did you try
> "reload scripts"?

I have not posted since my testing. With any luck, it will still be
working.

Thank you for the suggestion.

Mike
Re: [Dialog] I need two X-No-Archive Headers
#217245
Author: Oliver Cromm
Date: Mon, 25 Feb 2008 23:50
18 lines
2310 bytes
* Black Dragon wrote:

> Dan C wrote:
> 
>> What makes BSD not worth the effort is the hassle of getting useful
>> software to work.  
> 
> Nonsense. BSD and Linux typically share most of the same OSS software, and 
> I haven't had any trouble recently getting Linux binaries to run on (Free)
> BSD with emulation. 

What makes BSD harder is getting the hardware to work. I wasn't
surprised about the small graphics card trouble I had on my new machine,
but I got nervous when DesktopBSD didn't recognize the network card.
Still stuck with Viceta for the moment :-(

-- 
*Multitasking* /v./ Screwing up several things at once
Re: [Dialog] I need two X-No-Archive Headers
#217309
Author: Adam Funk
Date: Thu, 28 Feb 2008 21:34
18 lines
1501 bytes
On 2008-02-22, Marco Schmidt wrote:

> OK, thanks. I've heard of both 
>
>|X-No-Html: yes
>
> and
>
>|Distribution: usenet
>
> to express "do not use this article on the Web / outside of regular
> Usenet distribution channels". 

Google ignores them.


-- 
I put bomb in squirrel's briefcase and who gets blown up? Me!
Page 2 of 2 • 63 total messages
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads