Guest
May 20, 2012, 4:06 pm UTCHome arrow Commands arrow Then Do Something arrow Web Server Commands
header image
Web Server Commands
Written by Dream Dancer   
Nov 26, 2007 at 04:32 PM

Special  commands used in accessing a specially designed webpage setup to provide a means for Furbot to access and manipulate online database's. The specific command to access the webpage WAITS for the server to return the results. Currently, there's a timeout involved with how often you can access the webpage, it's hardcoded to 60 seconds at this time. This is both to permit the bot to continue to do what it was originally designed to do, that is, interact with the Furcadia server, and prevent possible abuse of the function. See Web Server Access for more details.

$WEB: Combine the URL {#0} data into variable {#1} optionally adding onto {#2}
0 &0 GET assumed/GET,POST,USER
1 1 Variable to use
2 2 Optional prefix data
Takes the selected stack, puts it together as though for webaccess, and sticks the results into the named variable. If you provide anything in #2, it will tack it onto the end of that string before storing the results.
$WEB: Remove the URL member named {#0} from the {#1} stack
0 0 Parameter to remove
1 &1 GET assumed/GET,POST,USER,ALL
Removes the named URL member, the possible stacks includes a special psuedo stack called ANY, this will cause the named member to be removed from all stacks.
$WEB: Reset the {#0} URL parameter stack
0 &0 GET assumed/GET,POST,USER,ALL
Clears the designated stack, this contains the special selection of ALL, will zap everything.
$WEB: Set URL {#0} Parameter {#1} to the value of {#2}, Strip Special Characters {#3}
0 &0 GET assumed/GET,POST,USER
1 1 Parameter Name
2 2 Value to use
3 &3 False assumed/False,True
Stores a URL parameter=value pair into the selected stack, optionally stripping special characters over encoding them. If the term of encoding special characters just confused you, remember why it's %20 instead of a space.
$WEB: Store the URL parameter named {#0} from the {#1} stack into variable {#2} {#3}
0 0 Parameter name
1 &1 USER assumed/USER,GET,POST,ANY
2 2 Variable to use
3 &3 Decoded assumed/Decoded,Raw
This retrieves a value from the selected stack, if you use the special parameter ANY, it searches USER, GET, then POST in that order for the named member. The #3 parameter is either RAW or DECODED, where decoding is reverting the special characters back into the human readable form.
$WEB: Store the URL string {#0} to the {#1} stack
0 0 String to use
1 &1 USER assumed/USER,GET,POST
Specifically for when you're using the redirection for the results, you can store the redirection URL into one of the stacks, (USER is there specifically for that purpose), and read the results rather like an extended variable, okies, a bit quirked, you DO have to extract the value into a normal variable to use, sortof like DS arrays, ...
$WEB: Transfer, Merge, Exchange, or Copy: {#0} the {#1} stack to the {#2} stack
0 &0 Transfer assumed/Transfer,Merge,Exchange,Copy
1 &1 GET assumed/GET,POST,USER
2 &2 USER assumed/USER,GET,POST
Complex operation designed to mangle the stacks in the ways indicated, it's an optional means of doing things other than having to extract the contents of say, the GET stack into a string so you can set up a different type of access, you can setup, say, the POST stack with the different parameters, then swap the stacks.
$WEB: WebFetch, using {#0}, follow redirection {#1}, include GET parameters {#2}, to variable {#3}
0 &0 GET assumed/GET,POST
1 &1 Follow assumed/True,False
2 &2 GET include assumed/True,False
3 3 Variable to use
The most important, and actually complex, of this whole system. The first parameter is the mode, either GET or POST, if it's POST, the contents of the POST array is always included, if it's GET, you DO have to specify to include the GET parameters. If you're using the redirection return from the server for the results, then you need to set the FOLLOW to FALSE, otherwise the results will be HTML Entity stripped into the result variable you specify.
Last Updated ( Feb 20, 2010 at 09:48 PM )
<Previous
header image