Commit graph

1613 commits

Author SHA1 Message Date
Dominik Sander
61b33bf37c
Merge pull request #2266 from dsander/rails52
Upgrade to Rails 5.2
2018-06-17 11:50:01 +02:00
Deng Yang
b2ba84a6e3
Update google_translation_agent.rb
leave translate_from empty to let google detect the source language automatically
2018-06-04 21:56:32 +08:00
Dominik Sander
5cd209234d
Merge pull request #2307 from sfischer13/master
Improve logic of "working?" in MqttAgent
2018-06-04 10:02:55 +02:00
Stefan Fischer
c7d311b630 Improve logic of "working?" 2018-06-03 16:38:03 +02:00
Ricardo Arturo Cabral
b3c6c7f80f
Remove open-uri require 2018-05-09 13:17:09 -04:00
Ricardo Arturo Cabral
99b0821700
Remove load_field 2018-05-09 08:59:34 -04:00
Ricardo Arturo Cabral
6c8bc39ac4
Pass URLs to Telegram API directly 2018-05-09 08:38:45 -04:00
Dominik Sander
e4b5e75e82 Fix HttpStatusAgent case insensitive header lookup
Ruby 2.5 added the `Hash#slice` method which allowed Rails 5.2 [to not
apply][1] it's ActiveSupport core extension. Because the Ruby
implementation is done in C it [does not call the `[]` method][2] which
is overridden by [`Faraday::Utils::Headers`][3] to achieve case
insensitive header look ups.

By calling the `Faraday::Utils::Headers#[]` directly we keep the case
insensitive lookup.

[1]: a524c955bf
[2]: ae92a9e4ed/hash.c (L1357-L1375)
[3]: 4381c2d62d/lib/faraday/utils.rb (L51-L54)
2018-05-05 10:14:06 +02:00
Dominik Sander
201b784562 Fix specs and deprecation warnings 2018-05-05 10:14:06 +02:00
Dominik Sander
ee485990f5 Upgrade Rails to 5.2 and adjust configuration to new defaults 2018-05-05 10:14:06 +02:00
dgw
27cd2e7d15 PushoverAgent: Rewrite to handle boolean true for html
For reasons that are not clear, String.try_convert(true) yields nil, not
a string. Go figure.
2018-04-20 16:10:44 -05:00
dgw
692db8f847 PushoverAgent: Match conventions in new html option
Per feedback on #2264
2018-04-20 04:11:32 -05:00
dgw
284e2dccc7 PushoverAgent: HTML message support
Pushover has supported displaying the `message` as HTML in its apps for
about three years. https://updates.pushover.net/post/117525190347/html-message-support
2018-04-20 03:18:09 -05:00
Antoine Meicler
fc2cb71c54 preventing payload to be an array when content_type is 2018-04-02 17:00:39 +02:00
Antoine Meicler
ec9fa2f947 factorize the negation 2018-03-31 16:21:01 +02:00
Antoine Meicler
396b65b5b2 Array 2018-03-30 12:40:22 +02:00
Antoine Meicler
a879eeaf7e line indentation 2018-03-30 11:16:04 +02:00
Antoine Meicler
fd2ee6f460 change payload type condition 2018-03-30 11:13:53 +02:00
bobbysteel
d7c69d1ea0
Fix per requests 2018-02-12 10:29:59 +00:00
bobbysteel
00d0a46cfb
Clarify xpath usage with example 2018-02-10 18:20:17 +00:00
James Hu
908f0b6b3d Escape \ in JSON string literal in WebsiteAgent code example 2018-02-02 08:27:02 -08:00
James Hu
d38cfdd70d Fix syntax error in Website Agent description 2018-02-01 10:34:36 -08:00
Akinori MUSHA
1c1e3eebe1
Merge pull request #2171 from aserpi/telegram-split-message
Split long Telegram messages
2018-01-29 22:55:19 +09:00
Alessandro Serpi
bdb887bbe2 Explicit Telegram Agent default behaviour 2018-01-29 13:18:55 +01:00
Alessandro Serpi
29471df4eb Fix split regex 2018-01-14 15:34:09 +01:00
Alessandro Serpi
4848716948 Improve Telegram Agent description 2018-01-14 15:33:40 +01:00
Alessandro Serpi
00e3119994 Split long Telegram messages 2018-01-14 15:32:51 +01:00
Stefan Siegl
4aaeb16d24
Rescue ZeroDivisionError on validation, closes #2188 2018-01-05 12:38:46 +01:00
Dominik Sander
7c1ec33d64 Fix Liquid interpolation in TwilioAgent helper methods
The Agent did not use `interpolate_with` in it's `receive` method,
which lead to `interpolated[...]` calls in `send_message` and
`make_call` always returning empty strings.

The new `interpolate_with_each` helper iterates over an array of
objects and yields each object in a `interpolated_with(object)`
context.

Fixes #2186
2018-01-04 10:45:03 +01:00
Dominik Sander
1e286bce0f
Merge pull request #2170 from dsander/add-websiteagent-array-extract-option
Add `array` extraction option to WebsiteAgent in HTML/XML mode
2017-12-01 10:49:19 +01:00
Alessandro Serpi
d45edcde7b
Refactor Telegram Agent 2017-12-01 10:44:18 +01:00
Dominik Sander
a04faa8245 Add array extraction option to WebsiteAgent in HTML/XML mode
Setting `array` to `true` for an extractor allows the extraction of list
elements into an array or when working with websites that have varying
amount of elements matching a specific selector:

Response A:
```html
<h1>header</h1>
<div id="content">
  <div></div>
  <div></div>
  <div class="bogus"></div>
<div>
```

Response B:
```html
<h1>header</h1>
<div id="content">
  <div></div>
  <div></div>
  <div class="bogus"></div>
  <div></div>
<div>
```

The goal is to extract the header and all `div`s inside `#content` that
are not `.bogus` into one Event. Having the `array` option makes this
possible with `css: '#content div:not(.bogus) ', array: true` which
would otherwise fail with an uneven amount of matches exception.

Currently the work around would be the extract the header and `#content`
in one WebsiteAgent and extract the `div`s in a second Agent. This does
not work in my use case because the HTML inside `#content` is
malformatted and leads to Nokogiri paring errors.
2017-11-29 14:56:59 +01:00
aserpi
1c8ef93873 Add options to Telegram Agent 2017-11-23 23:03:40 +01:00
Dominik Sander
ecf5a97da9
Merge pull request #2146 from dsander/dropbox-agents
Upgrade Dropbox Agents to new v2 API
2017-11-11 10:05:18 +01:00
Akinori MUSHA
23299f5fb2
Merge pull request #2157 from douniwan5788/web_request_proxy
add proxy support for WebRequestConcern
2017-11-11 15:01:02 +09:00
Dominik Sander
0ef06a389c Allow usage of custom Liquid tags in LiquidOutputAgent
By using the `interpolated` helper method  our custom tags like
`credential` can be used in the LiquidOutputAgent.

Fixes #2042
2017-11-10 22:06:17 +01:00
douniwan5788
9afb62a605
add proxy support for WebRequestConcern 2017-11-06 21:39:08 +08:00
Akinori MUSHA
d937934daf Add a workaround for broken AlreadyRetweeted error detection
https://github.com/sferik/twitter/pull/875
2017-10-29 23:09:00 +09:00
Dominik Sander
eb79f8da1f Upgrade Dropbox Agents to new v2 API 2017-10-16 21:12:47 +02:00
Akinori MUSHA
7023058f20 Do not treat already retweeted/favorited error as failure
There's no use to retry when those errors occur, so just log an error
message and let it go.
2017-10-10 20:52:04 +09:00
Dominik Sander
1448f155d8 Merge pull request #2138 from dsander/improve-telegram-agent
Make TelegramAgent FormConfigurable, DryRunable and add logging
2017-10-03 11:26:37 +02:00
Dominik Sander
da72ecd3af Make TelegramAgent FormConfigurable, DryRunable and add logging
Makes the Agent easier to use and to debug. It now verifies the API
token and auto completes the `chat_id`.

Log entries are only created on failure to avoid cluttering the Agent
log.

 #2135
2017-10-03 10:54:45 +02:00
Andrew Cantino
ec16163ecd Fix Run Event Propagation search action (#2124) 2017-09-21 02:07:11 -07:00
Dominik Sander
dc9d16812b Fix dry-run modal when clicking on icon in 'Dry Run' button
tl;dr: By using `e.currentTarget` instead of `e.target` we ensure to always
pass the `button` element to `Utils.handleDryRunButton`.

`target` refers to the actual element the user clicked on, we then
passed the glyphicon span to `Utils.handleDryRunButton` which requested
`window.location` via ajax because `$(button).data('action-url')` returned
`undefined`.
Evaluating the whole page then triggered
`Error: rails-ujs has already been loaded!`, as a result the user can not
interact with anything that requires `rails-ujs`, `jquery` or bootstrap
javascript.
2017-09-16 13:01:35 +02:00
Andrew Cantino
8925ddb8d5 Handle lazy loading of Agents in gems during Agent.receive! (#2125) 2017-09-16 00:47:57 -07:00
Akinori MUSHA
e99b82b1eb Prevent tweet expansion from firing more than once 2017-09-15 23:38:54 +09:00
Akinori MUSHA
5519e6a1a7 Encode screen_name and id_str in URLs 2017-09-15 23:38:54 +09:00
Akinori MUSHA
0b88ce0edc Enhance the tweets view of TwitterStreamAgent
- Use the `extended_tweet.full_text` property instead of `text`
- Show the time and links to the tweet and event for each tweet
- Clicking on the tweet text replaces it with the embedded tweet widget
2017-09-15 23:38:49 +09:00
Akinori MUSHA
0541b3a31f Merge pull request #2119 from huginn/liquid_lazy_agent_assocs
Do not instantiate all records when liquidizing a record collection
2017-09-11 11:15:02 +09:00
Akinori MUSHA
b4817c74b5 Do not instantiate all records when liquidizing a record collection
Saved memory will be small for the average agent, but this will allow
handling a large amount of agents going forward.
2017-09-08 21:04:30 +09:00