Supported Scripts

Top  Previous  Next

It's quite easy to use a script to pass information to GetWeb's CGI executable. Below, you'll find examples of both Linux and Powershell scripts to use as a guide:

 

Linux Script

#!/bin/bash

# set each part of the URL to send

UrlToCgi=$(printf "http://127.0.0.1/scripts/webgate.exe")

RecipientVar=$(printf "?USER=")

Recipient=$(printf "pageyou")

SenderVar=$(printf "&FRM=")

Sender=$(printf "fromme")

MessageVar=$(printf "&MSG=")

# set message to all the text sent on the command line

Message=$@

# url encode message text

Message=$(php -r "echo urlencode(\"$Message\");")

# build the request URL

FullUrl=$UrlToCgi$RecipientVar$Recipient$SenderVar$Sender$MessageVar$Message

# send the request

wget -O- "$FullUrl"

 

Powershell Script

# set each part of the URL to send

$UrlToCgi="http://127.0.0.1/scripts/webgate.exe"

$RecipientVar="?USER="

$Recipient="pageyou"

$SenderVar="&FRM="

$Sender="fromme"

$MessageVar="&MSG="

# set message to all the text sent on the command line

$Message=$args

# url encode message text

[uri]::EscapeUriString($Message)

# build the request URL

$FullUrl=$UrlToCgi + $RecipientVar + $Recipient + $SenderVar + $Sender + $MessageVar + $Message

# send the request

Invoke-WebRequest -Uri $FullUrl