User Tools

Site Tools


functions:others_functions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
functions:others_functions [2019/12/26 09:01] emcodemfunctions: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:character_string_functions|Character String Functions]] 
-  -[[functions:mathematics_functions|Mathematics 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 = "string/%variable%") 
- 
-$exists("C:\Windows\explorer.exe" {{:functions:FFAStrans_compute.jpg?nolink&50|}}  1 
- 
-$exists("C:\Windows\system32\win*" {{:functions:FFAStrans_compute.jpg?nolink&50|}}  98 
------------------------------ 
-===== $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 "Value" in a JSON data structure. 
-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/key/array you want to get. 
- 
- 
-Usages:\\ 
-$jsonencode(input string = "string/%variable%") 
-$jsonget(input string = "string/%variable%"[, input string = "string/%variable%"]) 
- 
-$jsonencode("D:\My\Media\folder" {{:functions:FFAStrans_compute.jpg?nolink&50|}}  D:\\My\\Media\\folder 
- 
- 
-$jsonencode('Hello "World"' {{:functions:FFAStrans_compute.jpg?nolink&50|}}}  Hello \"World\" 
- 
-$jsonget('{"things":{"myStuff":"some other stuff"}}', "things.myStuff" {{:functions:FFAStrans_compute.jpg?nolink&50|}}  some other stuff 
- 
-$jsonget('%s_info_ffprobe%', '[1].format_name' {{:functions:FFAStrans_compute.jpg?nolink&50|}}  
- mov,mp4,m4a,3gp,3g2,mj2 
- 
- 
------------------------- 
-===== $readarray ===== 
- 
-  * Returns an instance from a valid array which must be in the form of "["data", data, etc...]". All JSON formated data is valid. By default the function will return the first instance. If none is found it will return an empty string; "". 
-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 = "string/%variable%"[, input integer = integer/%variable%]) 
- 
-$readarray("[23, 55.5, 19]", 2)  {{:functions:FFAStrans_compute.jpg?nolink&50|}}  55.5 
- 
-$readarray('["make", "my", "day"]', 3)  {{:functions:FFAStrans_compute.jpg?nolink&50|}}  day 
- 
------------------------- 
-===== $regext ===== 
- 
-  * This is regular expression function. It extracts text based on recognition patterns. It uses the Perl Compatible Regular Expressions (PCRE) engine. http://www.pcre.org/ 
- 
-Usage :\\ 
-$regext(input string = "string/%variable%", pattern = "string/%variable%") 
- 
-$regext("<Duration value="1214"/>", "<Duration value="(\d+)"/>" {{:functions:FFAStrans_compute.jpg?nolink&50|}}  1214 
- 
-$regext("TVShow_EP0013.mxf", "/(EP\d{4})/" {{:functions:FFAStrans_compute.jpg?nolink&50|}}  EP0013\\ 
- 
----------------------- 
- 
-===== $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/%variable%)\\ 
-$dec(input string/integer = "string"/integer/%variable%) 
- 
- 
-$hex(8)  {{:functions:FFAStrans_compute.jpg?nolink&50|}}  8 
-$hex(15)  {{:functions:FFAStrans_compute.jpg?nolink&50|}}  f 
- 
-$dec(8) {{:functions:FFAStrans_compute.jpg?nolink&50|}}  8                    
-$dec("f"  {{:functions:FFAStrans_compute.jpg?nolink&50|}}  15 
- 
--------------------------- 
- 
-===== $guid ===== 
- 
-  * Returns a random GUID/UUID. 
- 
-Usage : \\ 
-$guid() 
- 
-$guid()  {{:functions:FFAStrans_compute.jpg?nolink&50|}}  bc067580-f7de-4e12-9f84-7e905bd60378 
- 
--------------------------- 
- 
-===== $xxhash ===== 
- 
-    * Returns an eight character hash for any file. Must include full path. The hash is created using Yann Collet's xxHash which is very fast and suits large video files. 
- 
-Usage : \\ 
-$xxhash(input string = "string/%variable%") 
- 
-$xxhash("x:\path\to\file.mxf" {{:functions:FFAStrans_compute.jpg?nolink&50|}}  61abf926 
- 
- 
-------------------------------------------- 
- 
-===== $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("metadata.xml" {{:functions:read_visual.jpg?nolink&50|}} 
- 
------------------------------ 
- 
-===== $urlencode ===== 
- 
-  * Converts the input string to an URL friendly string. 
- 
-Usage : \\ 
-$urlencode(input string = "string/%variable%") 
- 
-$urlencode("FFAStrans is #supercool!" {{:functions:FFAStrans_compute.jpg?nolink&50|}}  
- FFAStrans%20is%20%23supercool! 
- 
---------------------------- 
functions/others_functions.1577350891.txt.gz · Last modified: 2020/11/16 19:08 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki