{"action":"created","issue":{"url":"https://api.github.com/repos/cantino/huginn/issues/1234","labels_url":"https://api.github.com/repos/cantino/huginn/issues/1234/labels{/name}","comments_url":"https://api.github.com/repos/cantino/huginn/issues/1234/comments","events_url":"https://api.github.com/repos/cantino/huginn/issues/1234/events","html_url":"https://github.com/cantino/huginn/issues/1234","id":127627795,"number":1234,"title":"Use Trigger Agent to filter calculated date?","user":{"login":"tomkofford","id":13458756,"avatar_url":"https://avatars.githubusercontent.com/u/13458756?v=3","gravatar_id":"","url":"https://api.github.com/users/tomkofford","html_url":"https://github.com/tomkofford","followers_url":"https://api.github.com/users/tomkofford/followers","following_url":"https://api.github.com/users/tomkofford/following{/other_user}","gists_url":"https://api.github.com/users/tomkofford/gists{/gist_id}","starred_url":"https://api.github.com/users/tomkofford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomkofford/subscriptions","organizations_url":"https://api.github.com/users/tomkofford/orgs","repos_url":"https://api.github.com/users/tomkofford/repos","events_url":"https://api.github.com/users/tomkofford/events{/privacy}","received_events_url":"https://api.github.com/users/tomkofford/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-20T08:15:03Z","updated_at":"2016-01-21T05:24:01Z","closed_at":null,"body":"I have the following set up to scrape, filter, and publish a podcast:\r\n\r\n1.  Website Agent to scrape original podcast feed. I extract the original published date as 'pubDate' here. A sample date looks like \"Tue, 19 Jan 2016 17:59:18 +0000\".\r\n2.  Trigger Agent to filter against keywords. So far so good.\r\n3.  De Duplication Agent that filters matches on the enclosure URL.\r\n4.  Data Output Agent to provide the podcast feed.\r\n\r\nWorks great except that I need to limit my stored events (Heroku free plan). I don't want to keep events very long for duplicate checking, etc. I figure I can save events from the De Deplication Agent for a week or so and be fine. I'd like to limit the output of the Website Agent to events in the past week so prior events aren't duplicated.\r\n\r\nI'd like to add something to the Trigger agent to limit events to the previous week. I can get the two dates in timestamp format to use `>=` logic like this:\r\nTimestamp one week ago: `{{'now' | date: '%s' | minus : 604800}}`\r\nTimestamp of sample above: `{{pubDate | date: '%s'}}`\r\n\r\nIt would be really easy to do `EventTime >= WeekAgo`, but I can't figure out how to pull this off in the Trigger Agent. It seems like whatever I put in 'path' will get evaluated to be the JSON path, not an actual value. And it seems that 'value' must be compared to field found at 'path' in the rules.\r\n\r\nI also thought through adding it on the Website Agent (convert the date to timestamp), but that doesn't look possible either.\r\n\r\nMust I have an Event Formatting agent before the Trigger agent and add a new value that's a conversation of pubDate to timestamp format? Just lazy and looking for a shortcut ;-). I'm fine using a formatting agent, but if there's a more concise way to do this that I'm overlooking, I'd love to know. \r\n\r\nThanks!!"},"comment":{"url":"https://api.github.com/repos/cantino/huginn/issues/comments/173457473","html_url":"https://github.com/cantino/huginn/issues/1234#issuecomment-173457473","issue_url":"https://api.github.com/repos/cantino/huginn/issues/1234","id":173457473,"user":{"login":"cantino","id":83835,"avatar_url":"https://avatars.githubusercontent.com/u/83835?v=3","gravatar_id":"","url":"https://api.github.com/users/cantino","html_url":"https://github.com/cantino","followers_url":"https://api.github.com/users/cantino/followers","following_url":"https://api.github.com/users/cantino/following{/other_user}","gists_url":"https://api.github.com/users/cantino/gists{/gist_id}","starred_url":"https://api.github.com/users/cantino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cantino/subscriptions","organizations_url":"https://api.github.com/users/cantino/orgs","repos_url":"https://api.github.com/users/cantino/repos","events_url":"https://api.github.com/users/cantino/events{/privacy}","received_events_url":"https://api.github.com/users/cantino/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T05:24:01Z","updated_at":"2016-01-21T05:24:01Z","body":"Hey @tomkofford, welcome, and thanks for the clear description of your issue!\r\n\r\nI think you'd analyzed it correctly-- as it stands, the TriggerAgent expects JSONPaths, not Liquid templating.  If you'd like to try and change this, it might be a nice improvement, but we'd need to be careful to migrate everyone's existing TriggerAgents.  (I think we could likely migrate existing paths to something like `{{ path }}`, so `hello.world` would be `{{ hello.world }}`, although not everything in JSONPath is supported in Liquid, so it might not be a perfect upgrade.  Worth thinking about.)  You could also consider adding a mode for TriggerAgents where the values are interpreted as values with Liquid, not as paths."}}