From 1aac753ba2e95276af63bbaaedae9c2e89cb91c2 Mon Sep 17 00:00:00 2001 From: jantuomi Date: Mon, 18 Jul 2016 12:40:45 +0300 Subject: Create JSON Factory, http test server now dumps incoming telegram messages --- jsonfactory.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 jsonfactory.py (limited to 'jsonfactory.py') diff --git a/jsonfactory.py b/jsonfactory.py new file mode 100644 index 0000000..7cb316c --- /dev/null +++ b/jsonfactory.py @@ -0,0 +1,14 @@ +import json + + +class JSONFactory(object): + @staticmethod + def make(text, user, timestamp, ip): + message = json.dumps({ + "text": text, + "user": user, + "timestamp": timestamp, + "ip": ip + }) + + return message -- cgit v1.3