Jump to content

AutoIt as Html Preprocessor


piccaso
 Share

Recommended Posts

There are some 'use autoit on your server' solutions on this forum but i wasnt satisfied

with what i found.

i wanted to use <? php like ?> tags so i playd around a little with an old preprocessor i made

some time ago and thats what came out:au3pp.zip

how to set it up with Abyss X1

- Download and install Abyss

- copy au3pp.exe form the attached zip into the abyss directory

- Start it and log into your Management Console

- Click on... Configure -> Scripting Parameters

- Click on "Add" next to 'Interpreters'

- Set "Interface" to "CGI/ISAPI"

- Set "Interpreter" to full path to au3pp.exe like "C:\Abyss\au3pp.exe"

- Set "Arguments" like ' "%1" /Timer /AutoItPath "C:\\AutoIt3\\" '

! Make sure the Path to autoit is correct, backslashes are doubled and a trailing slash is there

- Set Associated Extensions to what you like... (au3,aha,ahp...)

- Restart the server and your done.

it forfills the CGI/1.0 Spec (i hope) so it should run on allmost every webserver...

a little preview of what you can do...

<title><? ConsoleWrite("it's a Test") ?></title>
<pre> Some 'Text...' </pre>
<?
    ConsoleWrite("Some Code...")
    For $i = 0 To 10
        ?><br> Repeat me <? ConsoleWrite($i)
    Next
?>
<br><br> Path Variable: <br>
<pre><? ConsoleWrite(StringReplace(EnvGet('PATH'),";",";" & @LF)) ?></pre>oÝ÷ Ù§ízºkzèqë,x"¶Z(Ébëajܨ»¥w¯z»zØZ¶éⶨºë¶¿uæîÌ"µÈZºÚ"µÍÓÕ^RXÛÛÛÛÛÛUÜ]J    ÌÎNÉÝ]IÝÉÌÎNÊBÛÛÛÛUÜ]J    ][ÝÚ] ÌÎNÜÈHÝ    ][ÝÊBÛÛÛÛUÜ]J    ÌÎNÉËÝ]IÝÉÌÎNÈ    [ÈBÛÛÛÛUÜ]J   ÌÎNÉÜIÝÈÛÛYH    ÌÎNÉÌÎNÕ^ÌÎNÉÌÎNÈ   ËÜIÝÉÌÎNÈ    [ÈBÛÛÛÛUÜ]J   ][ÝÔÛÛYHÛÙK][ÝÊBÜ  ÌÍÚHHÈLPÛÛÛÛUÜ]J   ÌÎNÉØÝÈX]YH   ÌÎNÊBPÛÛÛÛUÜ]J  ÌÍÚJB^ÛÛÛÛUÜ]J  ÌÎNÉØÝÉØÝÈ]XXN ØÝÉÌÎNÈ   [ÈBÛÛÛÛUÜ]J   ÌÎNÉÜIÝÉÌÎNÊBÛÛÛÛUÜ]JÝ[ÔXÙJ[Ù]
    ÌÎNÔU    ÌÎNÊK    ][ÝÎÉ][ÝË  ][ÝÎÉ][ÝÈ  [ÈJBÛÛÛÛUÜ]J  ÌÎNÉËÜIÝÉÌÎNÈ [È
Edited by piccaso
CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

I am not sure what you are attempting (if anything) different than the completed script here.

Don't get me wrong. I am not bashing your script, I just wanted to know what (if any) differences there are between your program and my au3 script when it comes to functionality.

Who else would I be?
Link to comment
Share on other sites

@this-is-me

i didnt see your post before.

... i think the forum search function is not my friend :geek:

i 'thaught' it would be to slow to write the preprocessor in autoit, but i didnt try it.

but since you wrote one i'll try yours :)

can you tell me where "webinclude.au3" is form?

and if you realy bored could you pn me your latest version with all reqired includes...

would be nice :lmao:

@the DtTvB

output buffer and ID processor?

whats that :ph34r:

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

piccaso: Here's it.

Normal echo:

consoleWrite ('Content-Type: text/plain' & @CrLf & @CrLf)
consoleWrite ('test ')
consoleWrite ('hello')oÝ÷ Ø}êÞw²jëh×6e ('test ');                                          $buffer &= 'test '
h ('Content-Type: text/plain');                       $header &= 'Content-Type: text/plain' & @CrLf
h ('Content-Disposition: text; filename=myfile.txt'); $header &= 'Content-Type: text/plain' & @CrLf
e ('hello');                                          $buffer &= 'hello'
f ();                                                 consoleWrite ('X-Powered-By: the DtTvB AutoIt Server' & @CrLf & $header & @CrLf $buffer)
;                                                     $buffer = ''

So I can echo the header any time I want, but before flushing the output.

And the ID processor is my random way of making dynamic pages.

It's like phpBB's TPL system that spyrorocks put something similiar to it in his autoforum.

In phpBB's TPL system, variables are like this: {varname}

But my ID processor, it's like this: <*** id="varname" />

So if I have this is my template file:

<font id="message" size="6" color="red" /> (Actually I never use <font> but this is just an example!)

It will become

<font id="message" size="6" color="red">Value of it!</font>

So I can apply css and javascript to it without using

<font id="message" size="6" color="red">{message}</font>

Link to comment
Share on other sites

I am not sure what you are attempting (if anything) different than the completed script here.

Don't get me wrong. I am not bashing your script, I just wanted to know what (if any) differences there are between your program and my au3 script when it comes to functionality.

If both are html preporcessors when they work the same way, then, you got aprox. the same results, is it?

I think that both should check each others results.

Of course, test with the same files to see if output is exactly the same,

then correct errors

In this right moment, there are two DirectHtmling Preprocessors, :ph34r::lmao:

(I mean outputing writes to the Web server Buffer Queue directly from the Html style code file (aha, ahp,.aux,etc..)):

c# PreProcessor (Picasso)

autoit Preprocessor (this-is-me) (I saw in your thread you got some fixes??? as posted by Smoke_N)

That is great that any scripter can use them or both, suitable to the kind of the app, the server, etcc..., that one prefer to use, the first or the second.

of course I think both should get a different Speed, is it?(mostly, for higher requests number)

I think they should be great apps. for making direct htmling.

I mean direct Htmling as posted in both threads, It should look like that:

<title><? ConsoleWrite("it's a Test") ?></title>
<pre> Some 'Text...' </pre>
<?
    ConsoleWrite("Some Code...")
    For $i = 0 To 10
        ?><br> Repeat me <? ConsoleWrite($i)
    Next
?>
<br><br> Path Variable: <br>
<pre><? ConsoleWrite(StringReplace(EnvGet('PATH'),";",";" & @LF)) ?></pre>

NOt bad Idea a preprocessor html-->Forum, for writing in this forum, this one here is something short

Edited by BasicOs
Autoit.es - Foro Autoit en Español Word visitors Image Clustrmap image: - Football Spanish team - Spanish team: Casillas, Iniesta, Villa, Xavi, Puyol, Campdevilla, etc..Programando en Autoit+Html - Coding Autoit-Html - Arranca programas desde Internet - Preprocesador de Autoit a http
Link to comment
Share on other sites

  • 2 years later...

Hello :)

But, It doesn't run on my PC:

I've installed abyss + configure + restart

I've copied au3pp.exe to "C:\Programme\Abyss Web Server\"

I've copied InterpreterTest.au3 to "C:\Programme\Abyss Web Server\htdocs\

I've opened IE an typed: http://localhost/InterpreterTest.au3 [+Return]

Result: C:\Programme\Abyss Web Server\htdocs\75680542.au3 (21) : ==> Missing separator character after keyword.: syntax Error syntax Error^ ERROR

Whats wrong? :mellow:

Where ist my mistake? :(

Edited by fielmann
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...