by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Deathbybandaid
@deathbybandaid
@benoliver999_gitlab https://pastebin.com/zdjj4Xxm
Type: Json Api Agent
xnaas
@xnaas
If anyone here uses the huginn-single-process Docker image...fair warning: don't upgrade your docker image to latest. :P
huginn/huginn#2605 got merged and murdered it hard lol
xnaas
@xnaas
I can't seem to get a Command Agent to actually work or do anything?
"action": "{% if message contains 'true' %}run{% endif %}"
The incoming event contains a line called "message" that is either "true" or "false"
xnaas
@xnaas
I've tried variations of "contains" or "==" etc. with no success
I feel like I'm not understanding what the liquid template actually wants? I tried reviewing what the Liquid documentation says, but that proved not helpful
Deathbybandaid
@deathbybandaid
"action": "{% if backfill_complete == 0 %}enable{% else %}disable{% endif %}"
that's one that I have
xnaas
@xnaas
yeah idk why it doesn't work
just coming up with a more complex solution with the trigger agent
¯_(ツ)_/¯
xnaas
@xnaas
Unrelated: I think Twitter silently approved my most recent API request/application.
Tommy Quissens
@quisse
Hey there, I'm having a website agent which is throwing an error. How can I get notified when this occurs? What agent type can detect this kind of anomaly?
xnaas
@xnaas
I could've sworn there was an Agent for watching this stuff, but maybe I've gone insane? 🤔
Gap Detector Event might do it for ya, @quisse?
Tommy Quissens
@quisse
Well the change detector or the gap detector possibly. But so far I can't seem to find how to configure them properly
Yeh but it doesn't do much :sweat_smile:
Is the value_path a required field?
xnaas
@xnaas
Likely.
I'm not sure what your output is for monitoring a website
but whatever is the name of a variable, I'd just use that
Then if after X days there
Tommy Quissens
@quisse
Ooh ok, bit confusing that it isn't in the json when creating the agent. Just got a ping :smile:
xnaas
@xnaas
Then if after X days there's no event with that, you could get a notification, presumably.
Tommy Quissens
@quisse
Ooh kk, feels like I'm getting closer. Thank you so much for your help :pray:
GChester
@GChester

Hey guys, I'm having trouble use the data returned from a Post Agent to pass into another Post Agent.

Here is a sample of the Event from the 1st Post Agent.

What I'm trying to pass on to the next Post Agent URL is the "id" new the bottom in the "body" element.

{
"issue_id": "239094",
"project": "Inbox",
"status": 201,
"subject": "Test Subject",
"tracker": "Task",
"headers": {
"Content-Type": "application/json",
"Vary": "Accept-Encoding",
"X-Request-Id": "qhffco9owy",
"X-Version-Id": "5.22.0.5ce806a40d.false",
"Date": "Tue, 26 May 2020 11:39:30 GMT",
"Content-Length": "453"
},
"body": "{\"id\":\"3sdxem1gsoojz4j3xo\",\"create_at\":1590493170588,\"update_at\":1590493170588}"
}

I tried using {{body.id}} but that is not working.

Any ideas on how to access the data "3sdxem1gsoojz4j3xo" in the next agent?

xnaas
@xnaas
That's a bit rough since everything after "body" is a considered one long string
and not separate variables
Is the ID always exactly 18 characters?
You could always see if jq is capable of easily pulling specific data out of a string, but I think you're more than likely going to have to go with a formatting agent and some regex fuckery?
Subrat Rout
@subratrout
How do I import some data from one of my google spreadsheet to a table in huginn app?
danquach
@danquach_twitter

I have this price which looks at the price of a car, and works if the price changes


  "expected_update_period_in_days": "2",
  "url": "https://www.northshoreacura.ca/en/used-inventory/acura/ilx/2019?namedSorting=priceASC&trimId=141655",
  "type": "html",
  "mode": "on_change",
  "extract": {
    "acura_ilx_price": {
      "xpath": "//*[contains(concat( \" \", @class, \" \" ), concat( \" \", \"inventory-tile-section-price__sale-price\", \" \" ))]//span",
      "value": "normalize-space(.)"
    }
  }
}

But what happened is the car disappeared and now the xpath returns an empty array as expected

[00:00:00] INFO -- : Values extracted: []

However an email isn't sent out as part of the run. Is there a way to notify if nothing matches the element?

deathbybandaid @deathbybandaid thinks people in here need to learn to use pastebin
The Doctor
@virtadpt
Has anyone here ever run into an source sequence is illegal/malformed utf-8 exception in Shell Agent?
gabriel-seoworks
@gabriel-seoworks

I've having trouble passing a message from an Event Formatting Agent to a Post Agent.

The event coming from the Event Formatting Agent is:

{
  "message": "Example site (www.example.com) has been Up for 5 minutes more info"
}

The Post Agent is set up with this payload:

"payload": {
    "body": "{{message}}"
  }

And the event created by the Post Agent contains:

"body": "{\"errors\":[{\"detail\":\"Request body validation error: \\\"message\\\" is not allowed\"}]}",

I feel like I'm missing something obvious, or not using the right agents for the job. Any thoughts appreciated :)

The Doctor
@virtadpt
You're doing it right. It's an eccentricity in how the Ruby json module does things.
Hang on, I just fixed a similar problem a few days ago, let me find it...
You can do it with the Jq Agent, but I don't recommend it.
The as_object Liquid tag.
Event:   {"something": {"nested": {"data": 1}}}
Liquid:  {{something.nested | as_object}}
Returns: {"data": 1}
The Doctor
@virtadpt
That will take the serialized, nested JSON and turn it back into a hash table.
gabriel-seoworks
@gabriel-seoworks
Thank you very much @virtadpt I'll try using your non-recommended method :)
The Doctor
@virtadpt
Give the as_object a try first. I think you'll find it much more to your liking.
matrixbot
@matrixbot
k0b0 Does anyone here use Huginn's webhooks and shell command agents? I want to use my Huginn to send it some commands and getting results back, i.e. sending a search term and getting a list of useful/most relevant links back to my email or posted to my matrix channel. I would really appreciate any help. Couldn't find any examples online...
k0b0 Or for example sending it a file link for download on the local nas...