-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrequests.yaml
More file actions
38 lines (34 loc) · 753 Bytes
/
requests.yaml
File metadata and controls
38 lines (34 loc) · 753 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
input:
generate:
count: 3
interval: 1s
mapping: |
root.title = "this is a test"
root.uuid = uuid_v4()
root.i = counter()
pipeline:
processors:
- python:
exe: ./venv/bin/python3
mode: isolated
script: |
import json
import requests
import time
data = content()
try:
msg = json.loads(data)["title"]
except:
msg = "nothing :("
root.msg = f"You said: '{msg}'"
root.at = time.ctime()
try:
root.ip = str(requests.get("https://api.ipify.org").text)
except:
root.ip = "no internet?"
output:
stdout: {}
logger:
level: OFF
http:
enabled: false