aboutsummaryrefslogtreecommitdiffstats
path: root/jsonfactory.py
diff options
context:
space:
mode:
authorjantuomi <jans.tuomi@gmail.com>2016-07-18 12:40:45 +0300
committerjantuomi <jans.tuomi@gmail.com>2016-07-18 12:40:45 +0300
commit1aac753ba2e95276af63bbaaedae9c2e89cb91c2 (patch)
treef2b71ebffd789f157df9f429e08ba7474f2d14a0 /jsonfactory.py
parentaa526d6d1b34113c2fdc6a97d6f46bc41b08713b (diff)
Create JSON Factory, http test server now dumps incoming telegram messages
Diffstat (limited to 'jsonfactory.py')
-rw-r--r--jsonfactory.py14
1 files changed, 14 insertions, 0 deletions
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