intake/demo/sources/echo.py

11 lines
232 B
Python
Raw Permalink Normal View History

#!/usr/bin/env python3
2023-06-09 00:07:19 +00:00
import hashlib, json, os, sys
echo = os.environ.get("MESSAGE", "Hello, world!")
item = {
"id": hashlib.md5(echo.encode("utf8")).hexdigest(),
"title": echo,
}
print(json.dumps(item), file=sys.stdout)