PageGate Filter Script Example 1 Video Tutorial Transcript
Welcome to the overview of the complete filter script examples we provide in our documentation. In this tutorial, we’ll be going over each of the different complete filter script examples and touching on what they show you how to do.
First, to find the examples, open a web browser and go to our website, www.notepage.net
Once there, go to the Support section on the left, then go to the PageGate Support section.
Click on ‘PageGate Manual/Documentation’ and then choose whether you want to open the online or PDF version.
Once you have the documentation open, go to ‘How PageGate Accepts Messages’, ‘Filter Pack’, and you should see the ‘Complete Script Examples’ section.
Also, before we go in to the examples, this is by no means a complete list of everything that the script can do and is intended to be a set of examples to guide you through the possibilities the script offers.
In our first example, we've configured the filter script to search the data from the input file for the text 'BIOHAZARD'. If it is found then the script will replace the current Recipient with 'bio_hazard' to indicate that all messages containing the word BIOHAZARD should go to the bio_hazard group. We're then inserting the static text 'WARNING! EXTREME HAZARD DETECTED:' before the matched search string.
This script demonstrates how to scan through input data to fundamentally change who a message is delivered to if your search criteria are found.
In our second example, we've configured the filter to scan through an XML file for the text 'Technical' or 'Network' in the <AlertType> tag. It will then temporarily store the information from the <Incident> and <Description> tags in the Temp variable. This collected data is then being passed to a statically named group in PageGate: techsupervisors.
This script demonstrates how to scan XML content and pull information from specific XML tags.
In our third, we've configured the filter script for a dispatching agency that needs all fire, rescue and accident calls dispatched but does not want non-emergency calls dispatched. To do this, the script reads in the entire input file and looks for certain keywords like FIRE,DISPATCHED or RESCUE,DISPATCHED or ACCID,DISPATCHED.
If it finds any of those three strings, the script then reformats the data, removes unwanted information, and determines who the message should be sent to.
In this particular example, all fire and rescue calls need to be separated from each other so that the fire calls go to the fire department and the rescue calls go to the rescue department, but all accident calls should go to both fire and rescue departments.
This script demonstrates many things at once. It demonstrates how to configure Boolean parameters and how to use the Temp and Flag variables for your search and replace strings. It also demonstrates how to configure a relatively complex chain of logic on precisely what needs to be done with your data.
In our fourth example, we're using an HTTPGET carrier to poll data from the National Weather service to have it delivered as an SMS.
This script demonstrates how to poll information from a web API and how to process that information with PageGate.
Our fifth example is designed specifically to work with an SMS Replies system and is configured to look for the words 'subscribe' and 'unsubscribe' in the body of reply messages. If it finds 'subscribe', it reconfigures the message to go to the recipient or group in PageGate named 'subscribe'. If it finds 'unsubscribe', it reconfigures the message to go to the recipient or group named 'unsubscribe'.
This script demonstrates how to have PageGate listen for reply text messages, then perform specific functions of certain keywords or key phrases appear within the reply.
Our sixth example is an extension of example 5 and uses the same ‘subscribe’/’unsubscribe’ system. However, in this example, unsubscribe replies execute a batch file or script contained within a batch file rather than delivering a message.
This can be especially useful if you're using an SQL environment and have PageGate's database linked to it with ODBC expressions. In theory, you could code a script to be executed that would automatically remove an entry from the users table of the database any time the 'unsubscribe' script was executed.
This script is another example of how to have PageGate listen for reply text messages, then perform specific functions of certain keywords or key phrases appear within the reply but instead of messaging someone, you’re executing a script (like those that can be run with Powershell) to perform a function completely outside of PageGate.
As we mentioned at the beginning of the overview, these are just meant to be examples of types of things you can do with the script and in no way represent a complete overview of its capabilities. For more information on how to configure your script, have a look at our ‘How to build a filter script’ video tutorial.
This concludes the overview of our complete script examples.
|