-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathmain.rye
44 lines (33 loc) · 828 Bytes
/
main.rye
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
Rye {
name: "load shopify orders"
}
(orders): kind://org.refaktor.shopify.orders
(invoice): kind://org.refaktor.cebelca.invoices
shopify: context {
api: load %.shop-auth.ryd
url: https://{{api/key}}:{{api/user}}@{{api/shop}}.shopify.com/api/v20-1/orders.json
}
cebelca: context {
api: load %.ceb-auth.ryd
url: https://{{api/key}}:{{api/user}}@cebelca.biz/api/?_r=invoice-sent&_m=import
}
on-error { |log-to %errors.log }
get shopify/url
|parse-json |^check "invalid json"
>> (orders) |^check "invalid orders structure"
|for-all {
>> (invoice) |^check "problem converting to invoice"
|to-json
|post* cebelca/url
}
Print {
name: "Rye editor"
}
url: start-server |print
with new-webview {
.set-title "Rye editor" ,
.set-size 600 500 ,
.bind 'lolo fn { } { print "LOLOLO" } ,
.navigate url ,
.run
}