From 8e348559761c10558237e3185b09922f1e5aae40 Mon Sep 17 00:00:00 2001 From: jantuomi Date: Mon, 18 Jul 2016 14:44:00 +0300 Subject: Forward messages from shoutbox to telegram successfully --- jsonfactory.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'jsonfactory.py') 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]" -- cgit v1.3