CGI Scripting with CRM

Chris Babcock <[email protected]>
Newsgroups gmane.mail.spam.crm114
Organization Kolonel Panic
Message-ID <[email protected]>
I thought this might be of interest. CGI scripting with CRM114 happens
to be insanely easy. The web page to be displayed is read from stdout.
Post data comes from stdin. Get data and everything else is in
environment variables. Here's a general test script that illustrates
the idioms involved, namely loading the available data, decoding
url-encoded strings and displaying results in HTML:

[chris@cl-t090-563cl cgi-bin]$ cat crmtest.cgi
#!/usr/local/bin/crm
# CGI test file. Show the data accessible to the script.

isolate (:param:) /:*:_dw:/
isolate (:environment:) //
syscall () (:environment:) /env/
isolate (:headers:) /Content-type: text\/html\n\n/
#isolate (::) //

# Uncomment the next line to skip decoding post data.
# goto /:skip_decode:/

{
match <fromend> [:param:] (:eol:) /\&/
alter (:eol:) /<br>\n/
liaf
}

{
match [:param:] (:space:) /\+/
alter (:space:) / /
liaf
}

{
match [:param:] (:hex: :value:) /%(..)/
alter (:hex:) /\\x:*:value:/
eval (:hex:) /:*:hex:/
liaf
}

:skip_decode:

{
match <fromend> [:environment:] (:eol:) /\n/
alter (:eol:) /<br>\n/
liaf
}

alter /:*:headers:<h1>CGI Success!<\/h1>\n\
<h2>Your CGI Environment:<\/h2>:*:environment:\n\
<h2>Parameters passed:<\/h2>\n:*:param:/ (:_dw:)

accept

-------

From there it's pretty straightforward to classify form input or
customize a webmail app to train Spam.

Chris

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com

_______________________________________________
Crm114-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crm114-general
signature.asc (application/pgp-signature, 489 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iQEcBAEBAgAGBQJJjC2PAAoJEASgqNsqZfCHSHYH/0u4wWh0Tg+jxyFTDzywnvjt
hprofvP4UaadlAg+B6YrcCbKdryCxca7SFK5qpqsLERoXUlBr0qGAPrdTmVby0Z+
EV7lrpeinA7g64oSBMIQqL459V6ofG7/8RgFiDpNkYlMY65K9g2zDNWwWOrBz5NX
3lGDDTGlYNvAAjBdFwZQejFvSlqFyoG60LZK8Cud2pH5QAVwFXrwJTNR6o3ANXjd
L2HBzW87BKfhgolCg+BpZk1a8BrRuVkqUTDMltvz5kUXvh+GEEHd2PqaCKcarbFZ
6bVT0RhtkUBFc2MqftYrkWl10Id1p1W/8ItWxbj9ag3cYNTirgTiwV86fJrMDMA=
=cdhw
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.