Article View: news.software.readers
Article #261657Re: Request help with 40tude dialog program syntax
From: Stijn De Jong
Date: Thu, 05 Jan 2017 23:42
Date: Thu, 05 Jan 2017 23:42
90 lines
5344 bytes
5344 bytes
> Sorry. There was an error in the previous script. Please use this one. This
> time, I've tested it thoroughly. :)
>
> <http://pastebin.com/2tMYRKM4>
Thanks for sticking with us, as I think it would be generally useful to
others also to have a different set of headers and cross checks based on
personal versus work posts and emails (for example to be able to avoid
posting to work newsgroups using the personal login and vice versa, to
avoid using business servers for personal posts).
As soon as I saw your post, I picked up: http://pastebin.com/raw/2tMYRKM4
and saved it to disk using control+a control+c so that all the syntax is
preserved and I added the following comments in the header.
// JJ_add_and_remove_headers_while_doublechecking_identity_ng_and_servers
// <http://pastebin.com/2tMYRKM4>
// From: JJ <jj4public@vfemail.net>
// Newsgroups: news.software.readers,alt.windows7.general
// Subject: Re: Request help with 40tude dialog program syntax
// Date: Thu, 5 Jan 2017 23:06:19 +0700
// Message-ID: <7vpx5y09pu98.1sukl5d600sda$.dlg@40tude.net>
// Original code for checking identity:
// http://dialog.datalist.org/scripts/CheckingIdentity.html
// Original code for modifying headers:
// http://dialog.datalist.org/scripts/RemoveHeaders.html
// ACTION:
// 1. Change identity as needed (search for "from,")
// 2. Change newsgroup as needed (search for "newsgroup,")
// 3. Change server as needed (search for "server,")
// 4. Change remove header as needed (search for "Remove_Headers :")
// 5. Change add header as needed (search for "Add_Headers :")
The only thing I changed was that I added the syntax to add an "or"
condition to the string match of the newsgroup lines (so that people have a
ready-made template for changing the list of newsgroups syntactically):
FROM:
if StrMatch(newsgroup, 'news.software.readers') then
result := 'id1'
TO:
if StrMatch(newsgroup, 'news.software.readers') or
StrMatch(newsgroup, 'alt.windows7.general') then
result := 'id1'
> I've changed it to include the ability to add new headers,
I was always planning on doing that so you think similarly to the way I
think, which is that personal and business headers can not only be removed,
but added. I just didn't know how to do that so I didn't ask that question.
Thanks for adding that capability to add headers as needed (which I'll test
out subsequently).
> and made it so that any identity may be empty.
I'm not sure what that means that any identity may be empty, but I think
what you mean is that the default should be that you shouldn't have to set
the identity and if you don't set the identity, then the settings will work
for all identities (which is, in effect, how the remove_headers original
program worked).
> Note that the string format for `Add_Headers` is
> different from `Remove_Headers` (see `AddHeader()` function comments and the
> example in the main decision code).
Thank you for pointing out that the syntax for adding headers is different
than the syntax for removing headers.
> I've also added to more variables `ForEmail` and `ForNewsgroup` to indicate
> which type of message should be processed so that it's more flexible. Both
> can be `true` to add/remove headers on both message types. But both must not
> be `false`, otherwise nothing will be processed. The `RemoveHeaders()`
> function was changed for this purpose.
Thank you for fixing the for-mail and for-news variables, which I think,
were each done differently in the two original programs that comprise the
bulk of this program.
> Since headers removal is performed first, then the headers insertion, you
> can use both `Remove_Headers` and `Add_Headers` to change any existing
> header. i.e. add if not exist, or change it if one exist. e.g.
>
> Remove_Headers:= 'User-Agent: ';
> Add_Headers:= 'User-Agent: Thunderbird 2086 (Windows 3000; NT9.0)'#13#10;
That's a nice program-flow consideration!
You can remove a header and then add a different header in its place.
I will test this out and let you know how it works.
Technical Details
Message-ID:
<o4mllr$1tes$1@gioia.aioe.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mailReferences:
<o491jh$7jr$1@gioia.aioe.org> <o4926s$933$1@gioia.aioe.org> <o492qg$a9k$1@gioia.aioe.org> <1ibo1gzmbqy5b.33119bupvh2q.dlg@40tude.net> <o4h57j$hhe$6@news.mixmin.net> <o4jr33$u80$1@news.mixmin.net> <7vpx5y09pu98.1sukl5d600sda$.dlg@40tude.net>Show Full Headers
Complete Article Headers
Message-ID: <o4mllr$1tes$1@gioia.aioe.org> Subject: Re: Request help with 40tude dialog program syntax Date: Fri, 6 Jan 2017 00:42:49 +0100 From: Stijn De Jong <stijndekoning@nlnet.nl> References: <o491jh$7jr$1@gioia.aioe.org> <o4926s$933$1@gioia.aioe.org> <o492qg$a9k$1@gioia.aioe.org> <1ibo1gzmbqy5b.33119bupvh2q.dlg@40tude.net> <o4h57j$hhe$6@news.mixmin.net> <o4jr33$u80$1@news.mixmin.net> <7vpx5y09pu98.1sukl5d600sda$.dlg@40tude.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mail Newsgroups: news.software.readers,alt.windows7.general Organization: Aioe.org NNTP Server Lines: 90 NNTP-Posting-Host: hfOAoZlqGeFs4SUbLxBJ8Q.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Comment: If this shows up, JJ is a veritable genius! X-Notice: Filtered by postfilter v. 0.8.2 X-Received-Bytes: 5160 X-Received-Body-CRC: 1289888389