-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathsave-article.wf.yaml
More file actions
48 lines (43 loc) · 1016 Bytes
/
save-article.wf.yaml
File metadata and controls
48 lines (43 loc) · 1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
apiVersion: 1
output: ComposeResult
# Input: url
tasks:
FetchWebPage:
run: http
inputs: "{$.Invocation.Inputs.default}"
ParseArticle:
run: parse-article
inputs: "{$.Tasks.FetchWebPage.Output}"
requires:
- FetchWebPage
ArticleContainsImage:
run: if
inputs:
if: "{!! $.Tasks.ParseArticle.Output.image}"
then:
# TODO resize image, change link
run: compose
inputs: "resized-image.png"
requires:
- ParseArticle
StoreInRedis:
run: redis-append
inputs:
default: "{$.Tasks.ParseArticle.Output}"
requires:
- ArticleContainsImage
NotifyUser:
run: notify-pushbullet
inputs:
default:
title: "{'Saved: ' + $.Tasks.ParseArticle.Output.url}!"
body: "{$.Tasks.ParseArticle.Output.title}"
requires:
- StoreInRedis
ComposeResult:
run: compose
inputs:
article: "{$.Tasks.ParseArticle.Output}"
url: "{$.Invocation.Inputs.default}"
requires:
- StoreInRedis