Difference between revisions of "Web DAT"

From TouchDesigner Documentation
Jump to: navigation, search
(TD Editor)
Line 1: Line 1:
 
{{Summary
 
{{Summary
|OPfamily=DAT
+
|long=[[Image:Using the Web DAT and XML DAT.jpg|200px|link=Using the Web DAT and XML DAT Vid]]
|OPlabel=Web
+
|OPfilter=False
+
The Web DAT fetches pages of data from a web connection. The data should be ASCII-readable. The Web DAT will automatically uncompress any gzip compressed page transfers. XML content is formatted into a readable indented structure, versus one long line normally sent by the server. An Info DAT can be used to obtain properties of the last page retrieved.
|OPtype=web
 
|long=The Web DAT fetches pages of data from a web connection. The data should be ASCII-readable. The Web DAT will automatically uncompress any gzip compressed page transfers. XML content is formatted into a readable indented structure, versus one long line normally sent by the server. An Info DAT can be used to obtain properties of the last page retrieved.
 
 
 
 
There are two main methods of retrieving a page from a web site using the Web DAT:
 
There are two main methods of retrieving a page from a web site using the Web DAT:
Line 11: Line 9:
 
 
 
The Fetch method simply fetches the page from the internet using the simple protocol "GET", while the Submit and Fetch method can be used for submitting form data to a server. By default the latter method uses the "POST" protocol.
 
The Fetch method simply fetches the page from the internet using the simple protocol "GET", while the Submit and Fetch method can be used for submitting form data to a server. By default the latter method uses the "POST" protocol.
 
+
 
Both methods allow a DAT table input to specify options while fetching. This table should consist of rows of name/value pairs. The first column consists of the names, while the second column consists of the values. The Fetch method simply concatenates the pairs into the specified URL, while the Update and Fetch method posts the pairs to a webserver, before fetching the resulting page.
 
Both methods allow a DAT table input to specify options while fetching. This table should consist of rows of name/value pairs. The first column consists of the names, while the second column consists of the values. The Fetch method simply concatenates the pairs into the specified URL, while the Update and Fetch method posts the pairs to a webserver, before fetching the resulting page.
 
 
 
For example, assume a table with the following contents is connected to the Web DAT:
 
For example, assume a table with the following contents is connected to the Web DAT:
 
 
{|border=1
+
{|border=1
 
|name
 
|name
 
|joe
 
|joe
Line 22: Line 20:
 
|month
 
|month
 
|May
 
|May
|}
+
|}
+
 
If the specified URL is:
 
If the specified URL is:
 
''http://www.example.com''
 
''http://www.example.com''
Line 38: Line 36:
 
The 2nd input of the Web DAT can be used for custom HTTP request headers to be specified as part of the request. Like the 1st input this should be a table of name/value pairs for header field name and the value. E.g
 
The 2nd input of the Web DAT can be used for custom HTTP request headers to be specified as part of the request. Like the 1st input this should be a table of name/value pairs for header field name and the value. E.g
 
 
{| border="1"
+
{| border="1"
|Content-Type
+
|Content-Type
|application/json
+
|application/json
|-
+
|-
|Date
+
|Date
|Tue, 12 Nov 2013 08:12:31 GMT
+
|Tue, 12 Nov 2013 08:12:31 GMT
|}
+
|}
 
+
 
Each row will automatically be merged into a single line of text separated by a colon. If the 2nd column is empty then the entry in the first column will have a semi-color append to it when it's turned into the request header.
 
Each row will automatically be merged into a single line of text separated by a colon. If the 2nd column is empty then the entry in the first column will have a semi-color append to it when it's turned into the request header.
 
 
 
See also [[XML DAT]], [[TCP/IP DAT]], [[WebSocket DAT]].
 
See also [[XML DAT]], [[TCP/IP DAT]], [[WebSocket DAT]].
 +
|OPlabel=Web
 +
|OPlicense=Non-Commercial
 +
|OPfamily=DAT
 +
|short=The Web DAT fetches pages of data from a web connection.
 +
|OPtype=web
 +
|OPfilter=False
 
|OPclass=webDAT_Class
 
|OPclass=webDAT_Class
|short=The Web DAT fetches pages of data from a web connection.
 
|OPlicense=Non-Commercial
 
 
}}
 
}}
 
{{ParameterPage
 
{{ParameterPage
|OPfamily=DAT
 
|Pagename=Fetch
 
|Pagesummary=
 
 
|items=
 
|items=
 
{{ParString
 
{{ParString
|OPfamily=DAT
 
|OPtype=web
 
|Parname=url
 
 
|Parorder=0
 
|Parorder=0
 
|Parsummary=The url address of the web page to be retrieved.
 
|Parsummary=The url address of the web page to be retrieved.
 
|Parlabel=URL
 
|Parlabel=URL
 +
|OPtype=web
 +
|OPfamily=DAT
 +
|Parname=url
 
}}
 
}}
 
{{ParButton
 
{{ParButton
|OPfamily=DAT
 
|OPtype=web
 
|Parname=fetch
 
 
|Parorder=1
 
|Parorder=1
 
|Parsummary=The data will be fetched when this button is pressed. Use this method to retrieve simple single pages from the internet. By default the Web DAT will stall the process until the whole page has been transferred, or an error occurs. You can do asynchronous downloads using the Asynchronous Fetch option.
 
|Parsummary=The data will be fetched when this button is pressed. Use this method to retrieve simple single pages from the internet. By default the Web DAT will stall the process until the whole page has been transferred, or an error occurs. You can do asynchronous downloads using the Asynchronous Fetch option.
 
|Parlabel=Fetch
 
|Parlabel=Fetch
 +
|OPtype=web
 +
|OPfamily=DAT
 +
|Parname=fetch
 
}}
 
}}
 
{{ParMenu
 
{{ParMenu
|OPfamily=DAT
 
|OPtype=web
 
|Parname=method
 
 
|Parorder=2
 
|Parorder=2
 
|Parsummary=Currently only POST is implemented, though this will be expanded with other techniques such as GET.
 
|Parsummary=Currently only POST is implemented, though this will be expanded with other techniques such as GET.
 +
|Parlabel=Submit Method
 +
|OPtype=web
 +
|OPfamily=DAT
 
|Paritems=
 
|Paritems=
 
{{Menuitem
 
{{Menuitem
 +
|Itemsummary=
 
|Itemlabel=POST
 
|Itemlabel=POST
 
|OPfamily=DAT
 
|OPfamily=DAT
 
|Parname=method
 
|Parname=method
|Itemsummary=
 
 
|Itemname=post
 
|Itemname=post
 
}}
 
}}
 
 
|Parlabel=Submit Method
+
|Parname=method
 
}}
 
}}
 
{{ParButton
 
{{ParButton
|OPfamily=DAT
 
|OPtype=web
 
|Parname=submitfetch
 
 
|Parorder=3
 
|Parorder=3
 
|Parsummary=Post all the name/value pairs from the input DAT to the server, then fetch the page specified in the URL parameter.
 
|Parsummary=Post all the name/value pairs from the input DAT to the server, then fetch the page specified in the URL parameter.
Line 100: Line 96:
 
Use this method to post data to a web server before retrieving the page. The data to be sent is in the form of name and value pairs. It can be specified with a table formatted DAT connected to the first input, where the first column represents data names, and the second column represents data values. The Web DAT will pause until the whole page has been transferred, or an error occurs.
 
Use this method to post data to a web server before retrieving the page. The data to be sent is in the form of name and value pairs. It can be specified with a table formatted DAT connected to the first input, where the first column represents data names, and the second column represents data values. The Web DAT will pause until the whole page has been transferred, or an error occurs.
 
|Parlabel=Submit and Fetch
 
|Parlabel=Submit and Fetch
 +
|OPtype=web
 +
|OPfamily=DAT
 +
|Parname=submitfetch
 
}}
 
}}
 
{{ParToggle
 
{{ParToggle
|OPfamily=DAT
 
|OPtype=web
 
|Parname=includeheader
 
 
|Parorder=4
 
|Parorder=4
 
|Parsummary=Includes the HTTP header in the output.
 
|Parsummary=Includes the HTTP header in the output.
 
|Parlabel=Include Header in Output
 
|Parlabel=Include Header in Output
 +
|OPtype=web
 +
|OPfamily=DAT
 +
|Parname=includeheader
 
}}
 
}}
 
{{ParInteger
 
{{ParInteger
|OPfamily=DAT
 
|OPtype=web
 
|Parname=timeout
 
 
|Parorder=5
 
|Parorder=5
 
|Parsummary=If this value is 0 the fetch request will never timeout. Any other value is how many milliseconds before the fetch times out.
 
|Parsummary=If this value is 0 the fetch request will never timeout. Any other value is how many milliseconds before the fetch times out.
 
|Parlabel=Timeout
 
|Parlabel=Timeout
 +
|OPtype=web
 +
|OPfamily=DAT
 +
|Parname=timeout
 
}}
 
}}
 
{{ParButton
 
{{ParButton
|OPfamily=DAT
 
|OPtype=web
 
|Parname=disconnect
 
 
|Parorder=6
 
|Parorder=6
 
|Parsummary=Closes the session.
 
|Parsummary=Closes the session.
 
|Parlabel=Disconnect
 
|Parlabel=Disconnect
 +
|OPtype=web
 +
|OPfamily=DAT
 +
|Parname=disconnect
 
}}
 
}}
 
{{ParToggle
 
{{ParToggle
|OPfamily=DAT
 
|OPtype=web
 
|Parname=asyncfetch
 
 
|Parorder=7
 
|Parorder=7
 
|Parsummary=Turn on this option to allow the download to occur in the background. You can use a [[DAT Execute DAT]] to do something when the data finally arrives.
 
|Parsummary=Turn on this option to allow the download to occur in the background. You can use a [[DAT Execute DAT]] to do something when the data finally arrives.
 
|Parlabel=Asynchronous Fetch
 
|Parlabel=Asynchronous Fetch
 +
|OPtype=web
 +
|OPfamily=DAT
 +
|Parname=asyncfetch
 
}}
 
}}
 
{{ParToggle
 
{{ParToggle
|OPfamily=DAT
 
|OPtype=web
 
|Parname=verifypeer
 
 
|Parorder=8
 
|Parorder=8
 
|Parsummary=
 
|Parsummary=
 
|Parlabel=Verify Peer Certificate
 
|Parlabel=Verify Peer Certificate
 +
|OPtype=web
 +
|OPfamily=DAT
 +
|Parname=verifypeer
 
}}
 
}}
 
 
 +
|Pagename=Fetch
 +
|Pagesummary=
 +
|OPfamily=DAT
 
}}
 
}}
 
{{:DAT Generator Common Page
 
{{:DAT Generator Common Page

Revision as of 14:08, 4 October 2017

  • Invalid title: ""

Summary
[edit]

Using the Web DAT and XML DAT.jpg

The Web DAT fetches pages of data from a web connection. The data should be ASCII-readable. The Web DAT will automatically uncompress any gzip compressed page transfers. XML content is formatted into a readable indented structure, versus one long line normally sent by the server. An Info DAT can be used to obtain properties of the last page retrieved.

There are two main methods of retrieving a page from a web site using the Web DAT:

  • Fetch
  • Submit and Fetch

The Fetch method simply fetches the page from the internet using the simple protocol "GET", while the Submit and Fetch method can be used for submitting form data to a server. By default the latter method uses the "POST" protocol.

Both methods allow a DAT table input to specify options while fetching. This table should consist of rows of name/value pairs. The first column consists of the names, while the second column consists of the values. The Fetch method simply concatenates the pairs into the specified URL, while the Update and Fetch method posts the pairs to a webserver, before fetching the resulting page.

For example, assume a table with the following contents is connected to the Web DAT:

{

PythonIcon.png[[{{{opClass}}}]]


Parameters - Page

Template:ParString Template:ParButton Template:ParMenu Template:ParButton Template:ParToggle Template:ParInteger Template:ParButton Template:ParToggle Template:ParToggle


Parameters - Common Page

Language language - - Select how the DAT decides which script language to operate on.

  • Input input - The DAT uses the inputs script language.
  • Node node - The DAT uses it's own script language.

Edit/View Extension extension - - Select the file extension this DAT should expose to external editors.

  • dat dat - various common file extensions.
  • From Language language - pick extension from DATs script language.
  • Custom Extension custom - Specify a custom extension.

Custom Extension customext - Specifiy the custom extension.  

Word Wrap wordwrap - - Enable Word Wrap for Node Display.

  • Input input - The DAT uses the inputs setting.
  • On on - Turn on Word Wrap.
  • Off off - Turn off Word Wrap.

TouchDesigner Build:

DATs
Art-Net • CHOP Execute • CHOP to • Clip • Convert • CPlusPlus • DAT •  Execute • DAT xport • Error • EtherDream • Evaluate • Examine • Execute • FIFO • File In • File Out • Folder • In • Indices • Info • Insert • Keyboard In • Lookup • Merge • MIDI Event • MIDI In • Monitors • MQTT Client • Multi Touch In • NDI • Null • OP Execute • OP Find • OSC In • OSC Out • Out • Panel Execute • Parameter • Parameter Execute • Perform • Render Pick • Reorder • Script • Select • Serial • SocketIO • SOP to • Sort • Substitute • Switch • Table • TCP/IP • Text • Touch In • Touch Out • Transpose • TUIO In • UDP In • UDP Out • UDT In • UDT Out • Web Client • Web • Web Server • WebSocket • XML

An Operator Family that manipulates text strings: multi-line text or tables. Multi-line text is often a command Script, but can be any multi-line text. Tables are rows and columns of cells, each containing a text string.

The generic thing that holds an Operator, and includes Flags (display, bypass, lock, render, immune) and its position/size in the network. Whether you "lay down an Operator" or "lay down an Node", you're doing the same thing.