mirror of
https://github.com/Fishwaldo/huginn.git
synced 2025-03-15 19:31:26 +00:00
parent
4eb9f8df05
commit
be0d0417bd
8 changed files with 10 additions and 12 deletions
|
@ -5,7 +5,7 @@ module Agents
|
|||
description <<-MD
|
||||
The Change Detector Agent receives a stream of events and emits a new event when a property of the received event changes.
|
||||
|
||||
`property` specifies a Liquid template that expands to the property to be watched, where you can use a variable `last_property` for the last property value. If you want to detect a new lowest price, try this: `{% assign drop = last_property | minus: price %}{% if last_property == blank or drop > 0 %}{{ price | default: last_property }}{% else %}{{ last_property }}{% endif %}`
|
||||
`property` specifies a [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) template that expands to the property to be watched, where you can use a variable `last_property` for the last property value. If you want to detect a new lowest price, try this: `{% assign drop = last_property | minus: price %}{% if last_property == blank or drop > 0 %}{{ price | default: last_property }}{% else %}{{ last_property }}{% endif %}`
|
||||
|
||||
`expected_update_period_in_days` is used to determine if the Agent is working.
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ module Agents
|
|||
|
||||
* `configure`: Target Agents have their options updated with the contents of `configure_options`.
|
||||
|
||||
Here's a tip: you can use Liquid templating to dynamically determine the action type. For example:
|
||||
Here's a tip: you can use [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) templating to dynamically determine the action type. For example:
|
||||
|
||||
- To create a CommanderAgent that receives an event from a WeatherAgent every morning to kick an agent flow that is only useful in a nice weather, try this: `{% if conditions contains 'Sunny' or conditions contains 'Cloudy' %}` `run{% endif %}`
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ module Agents
|
|||
|
||||
# Liquid Templating
|
||||
|
||||
In Liquid templating, the following variable is available:
|
||||
In [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) templating, the following variable is available:
|
||||
|
||||
* `events`: An array of events being output, sorted in the given order, up to `events_to_show` in number. For example, if source events contain a site title in the `site_title` key, you can refer to it in `template.title` by putting `{{events.first.site_title}}`.
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ module Agents
|
|||
description <<-MD
|
||||
The Email Agent sends any events it receives via email immediately.
|
||||
|
||||
You can specify the email's subject line by providing a `subject` option, which can contain Liquid formatting. E.g.,
|
||||
You can specify the email's subject line by providing a `subject` option, which can contain [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) formatting. E.g.,
|
||||
you could provide `"Huginn email"` to set a simple subject, or `{{subject}}` to use the `subject` key from the incoming Event.
|
||||
|
||||
By default, the email body will contain an optional `headline`, followed by a listing of the Events' keys.
|
||||
|
|
|
@ -32,7 +32,7 @@ module Agents
|
|||
|
||||
`google` `service_account_email` - The authorised service account.
|
||||
|
||||
`google` `key_file` OR `google` `key` - The path to the key file or the key itself. Liquid formatting is supported if you want to use a Credential. (E.g., `{% credential google_key %}`)
|
||||
`google` `key_file` OR `google` `key` - The path to the key file or the key itself. [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) formatting is supported if you want to use a Credential. (E.g., `{% credential google_key %}`)
|
||||
|
||||
`google` `key_secret` - The secret for the key, typically 'notasecret'
|
||||
|
||||
|
|
|
@ -28,9 +28,7 @@ module Agents
|
|||
|
||||
# Liquid Templating
|
||||
|
||||
The content you provide will be run as a Liquid template. The data from the last event received will be used when processing the Liquid template.
|
||||
|
||||
To learn more about Liquid templates, go here: [http://liquidmarkup.org](http://liquidmarkup.org "Liquid Templating")
|
||||
The content you provide will be run as a [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) template. The data from the last event received will be used when processing the Liquid template.
|
||||
|
||||
# Modes
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ module Agents
|
|||
* `user`: the user or group key (not e-mail address).
|
||||
* `expected_receive_period_in_days`: is maximum number of days that you would expect to pass between events being received by this agent.
|
||||
|
||||
The following options are all Liquid templates whose evaluated values will be posted to the Pushover API. Only the `message` parameter is required, and if it is blank API call is omitted.
|
||||
The following options are all [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) templates whose evaluated values will be posted to the Pushover API. Only the `message` parameter is required, and if it is blank API call is omitted.
|
||||
|
||||
Pushover API has a `512` Character Limit including `title`. `message` will be truncated.
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ module Agents
|
|||
|
||||
The WebsiteAgent can also scrape based on incoming events.
|
||||
|
||||
* Set the `url_from_event` option to a Liquid template to generate the url to access based on the Event. (To fetch the url in the Event's `url` key, for example, set `url_from_event` to `{{ url }}`.)
|
||||
* Alternatively, set `data_from_event` to a Liquid template to use data directly without fetching any URL. (For example, set it to `{{ html }}` to use HTML contained in the `html` key of the incoming Event.)
|
||||
* Set the `url_from_event` option to a [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) template to generate the url to access based on the Event. (To fetch the url in the Event's `url` key, for example, set `url_from_event` to `{{ url }}`.)
|
||||
* Alternatively, set `data_from_event` to a [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) template to use data directly without fetching any URL. (For example, set it to `{{ html }}` to use HTML contained in the `html` key of the incoming Event.)
|
||||
* If you specify `merge` for the `mode` option, Huginn will retain the old payload and update it with new values.
|
||||
|
||||
# Supported Document Types
|
||||
|
@ -128,7 +128,7 @@ module Agents
|
|||
|
||||
# Liquid Templating
|
||||
|
||||
In Liquid templating, the following variables are available:
|
||||
In [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) templating, the following variables are available:
|
||||
|
||||
* `_url_`: The URL specified to fetch the content from. When parsing `data_from_event`, this is not set.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue