- Introduced a new contract for script returns, requiring an object with `output`, `context`, and `skipRemaining` fields. - Refactored existing scripts to align with the new return structure, ensuring compatibility with the updated context management. - Added utility functions for normalizing context and step results, improving the handling of script execution context. - Updated various scripts (e.g., fetch-binary, fetch-html, fetch-http) to return structured output and context, enhancing data flow and usability. - Improved error handling for script returns, ensuring clearer feedback when invalid structures are returned. This update significantly enhances the flexibility and clarity of script interactions within workflows.
28 lines
771 B
YAML
28 lines
771 B
YAML
name: RSS - selfh.st first item to ntfy
|
|
scripts:
|
|
- script: fetch-rss-feed.js
|
|
config:
|
|
url: "https://selfh.st/rss/"
|
|
outputVar: item
|
|
jsonata: items[0]
|
|
- script: fingerprint.js
|
|
config:
|
|
key: selfhst-latest
|
|
jsonata: "data.item.guid ? data.item.guid : data.item.link"
|
|
- script: jsonata.js
|
|
config:
|
|
expression: |
|
|
{
|
|
"title": data.item.title,
|
|
"message": data.item.contentSnippet & "\n" & data.item.link,
|
|
"attach": data.item.mediaContent.url ? data.item.mediaContent.url : (data.item.mediaContent.$ ? data.item.mediaContent.$.url : undefined)
|
|
}
|
|
- script: ntfy.js
|
|
config:
|
|
url: https://ntfy.sh/jerapah-flow
|
|
|
|
triggers:
|
|
- type: HTTP
|
|
method: POST
|
|
path: /selfhst-rss
|