aboutsummaryrefslogtreecommitdiffstats
path: root/jsonfactory.py
diff options
context:
space:
mode:
authorjantuomi <jans.tuomi@gmail.com>2016-07-18 14:44:00 +0300
committerjantuomi <jans.tuomi@gmail.com>2016-07-18 14:44:00 +0300
commit8e348559761c10558237e3185b09922f1e5aae40 (patch)
tree6913e3f10759c87b2aae7205e377ac6dbc7ef4c0 /jsonfactory.py
parent1aac753ba2e95276af63bbaaedae9c2e89cb91c2 (diff)
Forward messages from shoutbox to telegram successfully
Diffstat (limited to 'jsonfactory.py')
-rw-r--r--jsonfactory.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/jsonfactory.py b/jsonfactory.py
index 7cb316c..be70996 100644
--- a/jsonfactory.py
+++ b/jsonfactory.py
@@ -3,7 +3,7 @@ import json
class JSONFactory(object):
@staticmethod
- def make(text, user, timestamp, ip):
+ def make_object(text, user, timestamp, ip):
message = json.dumps({
"text": text,
"user": user,
@@ -12,3 +12,7 @@ class JSONFactory(object):
})
return message
+
+ @staticmethod
+ def make_array(object_list):
+ return "[\n" + ",\n".join(object_list) + "\n]"