functions:others_functions
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| functions:others_functions [2019/12/24 13:26] – [$jsonencode and $jsonget] benjamin | functions:others_functions [2019/12/27 21:43] (current) – removed benjamin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ======= Functions ======= | ||
| - | All these functions will manipulate character strings to fit your needs. Functions can use into conditional node and populate variable node and keep the result in a variable. | ||
| - | |||
| - | There are 3 groups of functions :\\ | ||
| - | -[[functions: | ||
| - | -[[functions: | ||
| - | -**Others functions** | ||
| - | |||
| - | ------ | ||
| - | ====== Others Functions ====== | ||
| - | |||
| - | ===== $exists ===== | ||
| - | |||
| - | * This is a file function that will tell if file(s) exists. Returns the amount of files found and and 0 if it there is no match. | ||
| - | |||
| - | Usage:\\ | ||
| - | $exists(input string = " | ||
| - | |||
| - | $exists(" | ||
| - | |||
| - | $exists(" | ||
| - | ----------------------------- | ||
| - | ===== $base64 ===== | ||
| - | TODO: seems to be broke currently | ||
| - | |||
| - | ------- | ||
| - | ===== $jsonencode and $jsonget===== | ||
| - | |||
| - | * $jsonencode : Converts the input string to an JSON friendly string. | ||
| - | Note that this does not produce any JSON data structure but one can use the result as a " | ||
| - | This can be used in order to produce a JSON string for further automatic processing, e.g. send a POST request to some 3rdparty API using the HTTP Request processor. Or to write a JSON File using the Write File processor. | ||
| - | * $jsonget : Retrieves the value from a JSON object key. The first argumenst accept a string or a variable representing a valid JSON string. In the second section you refer to the object/ | ||
| - | |||
| - | |||
| - | Usages:\\ | ||
| - | $jsonencode(input string = " | ||
| - | $jsonget(input string = " | ||
| - | |||
| - | $jsonencode(" | ||
| - | |||
| - | |||
| - | $jsonencode(' | ||
| - | |||
| - | $jsonget(' | ||
| - | |||
| - | $jsonget(' | ||
| - | | ||
| - | |||
| - | |||
| - | ------------------------ | ||
| - | ===== $readarray ===== | ||
| - | |||
| - | * Returns an instance from a valid array which must be in the form of " | ||
| - | This can be used in combination with another processor which generates JSON on output, for example loudness filter or in combination again with a HTTP Get processor that receives JSON data from a 3rdparty API. | ||
| - | |||
| - | Usage:\\ | ||
| - | $readarray(input string = " | ||
| - | |||
| - | $readarray(" | ||
| - | |||
| - | $readarray(' | ||
| - | |||
| - | ------------------------ | ||
| - | ===== $regext ===== | ||
| - | |||
| - | * This is regular expression function. It extracts text based on recognition patterns. It uses the Perl Compatible Regular Expressions (PCRE) engine. http:// | ||
| - | |||
| - | Usage :\\ | ||
| - | $regext(input string = " | ||
| - | |||
| - | $regext("< | ||
| - | |||
| - | $regext(" | ||
| - | |||
| - | ---------------------- | ||
| - | |||
| - | ===== $hex and $dec ===== | ||
| - | |||
| - | * $hex : Converts a decimal integer to hexadecimal number. | ||
| - | * $dec : Converts a hexadecimal number to decimal integer. Function accepts both quoted and unquoted input. | ||
| - | Usages : \\ | ||
| - | $hex(input integer = integer/ | ||
| - | $dec(input string/ | ||
| - | |||
| - | |||
| - | $hex(8) | ||
| - | $hex(15) | ||
| - | |||
| - | $dec(8) {{: | ||
| - | $dec(" | ||
| - | |||
| - | -------------------------- | ||
| - | |||
| - | ===== $guid ===== | ||
| - | |||
| - | * Returns a random GUID/UUID. | ||
| - | |||
| - | Usage : \\ | ||
| - | $guid() | ||
| - | |||
| - | $guid() | ||
| - | |||
| - | -------------------------- | ||
| - | |||
| - | ===== $xxhash ===== | ||
| - | |||
| - | * Returns an eight character hash for any file. Must include full path. The hash is created using Yann Collet' | ||
| - | |||
| - | Usage : \\ | ||
| - | $xxhash(input string = " | ||
| - | |||
| - | $xxhash(" | ||
| - | |||
| - | |||
| - | ------------------------------------------- | ||
| - | |||
| - | ===== $read ===== | ||
| - | |||
| - | * $read : Reads the contents of a any text file. The function will automatically try to determine correct encoding. If storing as a variable the string length is **limited to approximately 80.000 characters**. | ||
| - | |||
| - | |||
| - | $read(" | ||
| - | |||
| - | ----------------------------- | ||
| - | |||
| - | ===== $urlencode ===== | ||
| - | |||
| - | * Converts the input string to an URL friendly string. | ||
| - | |||
| - | Usage : \\ | ||
| - | $urlencode(input string = " | ||
| - | |||
| - | $urlencode(" | ||
| - | | ||
| - | |||
| - | --------------------------- | ||
functions/others_functions.1577193973.txt.gz · Last modified: 2020/11/16 19:08 (external edit)