I’m just getting started with documenting the little mini programming language that has been built into the Moose for extracting useful data from webpages and RSS feeds. Much more will follow. But if you stumble onto this page in its current unfinished form, just nevermind it.
| Command | Command Name | Description | Click for details page |
|---|---|---|---|
| ^ or ; or * or ~ | Delimiters | The very first character determines the "Delimiter" that will separate all the commands from each other. It can be any character, but I suggest ^ | Delimiters |
| a | Keep After | Find something, Keep whatever is After it. Discards preceeding stuff. Whatever remains is called the Chop Result. | KeepAfter |
| b | Keep Before | Find something, Keep whatever is Before it. Discards subsequent stuff. Whatever remains is called the Chop Result. | KeepBefore |
| g | Keep After Including | Find something, Keep it and whatever is After it. Discards preceeding stuff. Whatever remains is called the Chop Result. | KeepAfterIncluding |
| h | Keep Before Including | Find something, Keep it and whatever is Before it. Discards subsequent stuff. Whatever remains is called the Chop Result. | KeepBeforeIncluding |
| SaveAppend | Append to Saved | Append the current Chop Result into the Saved-Area, after whatever was already there. | SaveAppend |
| SavePrepend | Prepend to Saved | Inserts (prepends) the Chop Result into the beginning of the Saved-Area, ahead of whatever was already there. | SavePrepend |
| RestoreDiscarded | Restore Discarded | Restore the subsequent stuff that was discarded. | |
| RestoreOriginal | Restore Original | Restores the original text, starting again prior to any chopping. | |
| RestoreUndo | Restore Undo | Restores as if Undoing the last 'Keep After' chop. | |
| RestoreSaved | Restore Saved | Moves Saved Area content back into the Chop Result, then Clears Saved Area. | |
| Continue | Continue | Continue does Append to Saved Area followed by Restore Discarded. | |
| t | Text | Inserts some text, Appended to the Saved Area. | |
| ' ' (spacebar) | Text spaced | Inserts a space, then some text, Appended to the Saved Area. | |
| u | Text in front | Inserts some text, ahead of everything else in the Saved Area. | |
| + | Plus | Converts the current Chop Result into a numeric value, then performs Addition using whatever follows the plus sign. | |
| - | Minus | Converts the current Chop Result into a numeric value, then Subtracts whatever follows the minus sign. | |
| * | Multiply | Converts the current Chop Result into a numeric value, then Multipies with whatever follows. | |
| / | Divide | Converts the current Chop Result into a numeric value, then Divided by whatever follows. | |
| ^ | Power | Converts the current Chop Result into a numeric value, then uses whatever follows as a power Exponent. | |
| % | Modulo | Converts the current Chop Result into a numeric value, and applies Modulo to it. | |
| Abs | Absolute value | Absolute value. Negative numbers are turned into Positive numbers. | |
| d | Decimal points | Rounds the Chop Result to show 0 or more decimal points. eg. D2 means 2 decimal points. | |
| Trim | Trim | Trim removes extra whitespace from the Chop Result. | |
| Int | Int | Discards the decimal points from a number in Chop Result, without rounding. | |
| Replace | Replace | Replaces the first matching Thing in Chop Result with a Replacement. | |
| ReplaceAll | ReplaceAll | Replaces All the matching Things in Chop Result the Replacement. | |
| GetXML | GetXML | Gets a value from with XML tags, substituting a default value if Empty or Fail. | |
| If | If | Test the Chop Result, If the test is 'True', then do an inline action, or whatever is inbetween IF..ENDIF or IF..ELSE | |
| Elseif | Elseif | ||
| Else | Else | ||
| Endif | Endif | ||
| If tests | see table below to see what IF's can test for. | ||
| If inline actions | see table below for inline things like If:Empty:Exit | ||
| If And Or | How to use 'And' and 'Or' logic with IFs. | ||
| Clear | Clear | Clear the current Chop Result. | |
| ClearAll | ClearAll | Clear the current Chop Result and Saved-Area. | |
| ClearSaved | ClearSaved | Clear the Saved Area. | |
| Left | Left | Keeps the Left-most characters of Chop Result and discards the rest. eg. Left:3 keeps 3 characters. | |
| Right | Right | Keeps the Right-most characters of Chop Result and discards the rest. eg. Right:4 keeps 4 characters. | |
| Mid | Mid | Keeps characters from the Middle of Chop Result, discarding the rest. eg. Mid:5:10 starts at the 5th character and keeps 10 characters. | |
| StripHTML | StripHTML | Removes as much HTML tags as it can from the current Chop Result, to leave only plain text. | |
| StripTags | StripTags | Removes xml tags like | |
| StripHeader | StripHeader | Removes the http header. | |
| RegEx | RegEx | Applies a 'Regular Expression' (RegEx) onto the current Chop Result. | |
| Tags | Tags | Puts <xml> Tags:___ before and after the Chop Result, then Continue. | |
| Debug | Debug | Starts Debug mode to step through commands one at a time. | |
| GetCDATA | GetCDATA | Finds and extracts into Chop Result whatever is in the next nearest CDATA, then Continue. | |
| rsslistf | RSS list forward | Separates web page items into a list RSS style going forward. | |
| rsslistb | RSS list backward | Separates web page items into a list RSS style going backwards. | |
| PrepRss | Prep as RSS | Prepares a webpage as if it were a list of things like an RSS feed. | |
Below are the various IF tests
| Test, Example | Description | Link for details |
|---|---|---|
| If:s= eg. If:s=fish | If the string in the Chop Result is equal to: | |
| If:s<> eg. If:s<>fish | If the string in the Chop Result is not equal to: | |
| If:sl= Eg. If:sl=5 | If the length of the string in the Chop Result is equal to: | |
| If:sl<> eg. If:sl<>5 | If the length of the string in the Chop Result is not equal to: | |
| If:sl< eg. If:sl<5 | If the length of the string in the Chop Result is less than: | |
| If:sl> eg. If:sl>0 | If the length of the string in the Chop Result is greater than: | |
| If:sl<= eg. If:sl<=5 | If the length of the string in the Chop Result is less than or equal to: | |
| If:sl>= eg. If:sl>=5 | If the length of the string in the Chop Result is greater than or equal to: | |
| If:n= eg. If:n=12 | If the number in the Chop Result is equal to: | |
| If:n<> eg. If:n<>5 | If the number in the Chop Result is not equal to: | |
| If:n> eg. If:n>5 | If the number in the Chop Result is greater than: | |
| If:n< eg. If:n<5 | If the number in the Chop Result is less than: | |
| If:n>= eg. If:n>=5 | If the number in the Chop Result is greater than or equal to: | |
| If:n<= eg. If:n<=5 | If the number in the Chop Result is less than or equal to: | |
| If:Empty | If the Chop Result is empty, length of zero. | |
| If:Found | If a previous Find command was used, and it succeeded, this will be True. | |
| If:NotFound | If a previous Find command didn't match, this will be True. | |
| If:f eg. If:frss | Tries to Find a word or string within Chop Result, allowing 'If' to test for Found or NotFound. | |
| If:x eg. If:xrss | If letters after x are 'not found', the IF test succeeds with NotFound true. |
