Commit graph

963 commits

Author SHA1 Message Date
9ac1a8c558 Update with feedback 2018-12-17 15:24:32 +08:00
8370c87db1 Fixed up test names 2018-12-14 14:24:31 +08:00
52bc83f94a update tests for Webhook Agent and don't add a nil entry if header_key is empty 2018-12-14 14:07:26 +08:00
Scott Boggs
211ff5a2bf
fixed intentation 2018-11-13 09:36:36 -05:00
D. Scott Boggs
c7c4d98283 Added better validations and parsing of the location when using the darksky provider for the weather agent. 2018-11-11 21:00:44 -05:00
Akinori MUSHA
e81ae4a65c
Merge pull request #2353 from whtsky/mergeJSONParse
Support merge mode in JsonParseAgent
2018-08-30 16:28:22 +09:00
Wu Haotian
753af61df9
Support merge mode in JsonParseAgent 2018-08-25 14:35:57 +08:00
a10kiloham
0f4cabf86e
Deprecated api 2018-08-17 11:02:14 +01:00
Akinori MUSHA
d952e91426 Encode raw_mail in Base64
Because e-mails are often in a non-UTF-8 "legacy" encoding, it cannot
always be carried via Event (JSON).
2018-08-05 23:10:19 +09:00
Irfan Charania
2c9b9bb29c Update DataOutputAgent accept header for browser compatibility (#2338)
* Update accept header for browser compatibility

Allows browser to display content as xml instead of plain text

Ref: https://stackoverflow.com/a/7001617/4397001

* Updated specs
2018-07-31 11:00:25 +02:00
Stefanus
402f8645d6 Make 'expected_receive_period_in_days' of PostAgent optional (#2333)
* Make 'expected_receive_period_in_days' optional due to new implementation of 'working?'

* Adjust spec
2018-07-16 10:15:02 +02:00
Stefanus
44709dc9a7 Fix "working?" of PostAgent (#2329)
* Fix "working?" of PostAgent

* Adjust specs

* Enhance specs

* Fix specs

* Fix code style

* Fix typo

* Change implementation of "working?"

* Fix spec

* Add comments

* Add new test

* Fix syntax error

* Restore original spec
2018-07-14 10:52:57 +02:00
Dominik Sander
61b33bf37c
Merge pull request #2266 from dsander/rails52
Upgrade to Rails 5.2
2018-06-17 11:50:01 +02:00
Ricardo Arturo Cabral
49f9cb45f1
Fix unit tests for payloads with media 2018-05-09 08:58:04 -04:00
Dominik Sander
1147e75c6b Use not_found replacement for deprecated missing matcher 2018-05-05 10:15:40 +02:00
Dominik Sander
201b784562 Fix specs and deprecation warnings 2018-05-05 10:14:06 +02:00
Akinori MUSHA
3e508310ac
Merge pull request #2216 from dsander/ruby2.5
Allow to run on ruby 2.5 and fix warnings
2018-04-04 20:20:48 +09:00
Antoine Meicler
3ce696d127 array to be valid in post_agent_spec 2018-03-31 19:22:48 +02:00
Dominik Sander
74394fe586 Upgrade gems for ruby 2.5 support and to remove warnings
* `delayed_job` 4.1.4 added a syntax fix for ruby 2.5
* `devise` 4.4.0` added a syntax fix for ruby 2.5
* `rufus-scheduler` 3.3.3 fixed Fixnum deprecation warnings
* `erector` was forked to fix a Fixnum deprecation warning

Fix exception in MQTT::FakeServer, when stopping the server kill the
thread before closing the socket to avoid calling `@socket.accept` on a
closed socket.
2018-02-10 11:00:18 +01: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
71800db0fc Improve Telegram Agent tests 2018-01-26 20:48:27 +01:00
Alessandro Serpi
503bf7a9be Add tests for Telegram message splitting 2018-01-14 15:33:28 +01:00
Alessandro Serpi
1e0e1652b6 Refactor Telegram Agent spec 2018-01-14 15:32:33 +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
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
05b1651af2 Simplify Telegram Agent tests 2017-11-24 12:28:41 +01:00
aserpi
f662ed1d2a Add new tests for Telegram Agent 2017-11-24 00:06:22 +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
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
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
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
Akinori MUSHA
ed9da9f35e Add working and url to AgentDrop for diagnostic purposes 2017-09-08 18:39:37 +09:00
Shaya G
5e1e5a1907 only add itunes icon if ns_itunes 2017-09-06 23:43:34 -04:00
HyShai
69f4f22684 add tests 2017-09-05 16:33:46 -04:00
Akinori MUSHA
347381cf45 Merge pull request #2113 from dsander/fix-flaky-spec
Fix flaky spec
2017-09-05 23:42:50 +09:00
Dominik Sander
dc099b31ae Fix flaky spec
The `select_agent_type` helper is waiting for the options editor to be
initialized, which will never happen for Agents that are
FormConfigurable. The GrowlAgent was recently changed to
FormConfigurable which mean the spec should always have failed.
I have no idea how it passes on CI in some cases but this should fix the
'random' failures.
2017-09-05 12:05:16 +02:00
Akinori MUSHA
ef03f9f8b6 Fix DataOutputAgent so that it can output items with multiple categories
The to_xml method encodes `{ "category": ["a", "b"] }` as follows:
```xml
<item>
 <category>
  <category>a</category>
  <category>b</category>
 </category>
</item>
```
Instead of this:
```xml
<item>
 <category>a</category>
 <category>b</category>
</item>
```
Even if `category` is a singular noun.  This feature prevents
DataOutputAgent from emitting multiple `<category>` elements (or
`<enclosure>`, etc.) properly, so I've added a tweak to fix the
resulted XML document.

I know the code in the current form is far from optimal, so I think
we'll have to revisit here soon or later...
2017-09-04 20:01:22 +09:00
Akinori MUSHA
30a4a67a0f Replace references to https://github.com/cantino/huginn with huginn/huginn 2017-09-01 18:56:10 +09:00
Dominik Sander
e9709aec0a Prevent PeakDetectorAgent from storing invalid data in it's memory
The Agent expects the data in its memory groups to be castable to a
float. By attempting the type cast when receiving events we prevent the
memory from being corrupted with invalid data which lead exceptions
while trying to access it.

 #2101
2017-08-31 21:17:42 +02:00
Akinori MUSHA
0339a23e45 Support the AtomYoutube feed format of Feedjira
This fixes #2054.
2017-08-10 21:46:48 +09:00
Akinori MUSHA
4665c305c7 Add a new option include_raw_mail to ImapFolderAgent 2017-08-06 10:01:42 +09:00
Akinori MUSHA
734b84d185 Add message_id to the payload format of ImapFolderAgent 2017-08-03 20:38:40 +09:00
Akinori MUSHA
d9309b98a9 Refactor the ImapFolderAgent spec and turn a nop into expectation 2017-08-03 20:36:11 +09:00