aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bot/ircmeeting/agenda.py7
-rw-r--r--bot/ircmeeting/meeting.py5
2 files changed, 12 insertions, 0 deletions
diff --git a/bot/ircmeeting/agenda.py b/bot/ircmeeting/agenda.py
index 7ee9beb..4f0bd00 100644
--- a/bot/ircmeeting/agenda.py
+++ b/bot/ircmeeting/agenda.py
@@ -89,3 +89,10 @@ class Agenda(object):
str = urllib.unquote(str)
result = json.loads(str)
return result
+
+ def post_result(self):
+ data = urllib.quote(json.dumps([self._votes]))
+ result_url = str.format(self.conf.result_url,
+ self.conf.voting_results_user,
+ self.conf.voting_results_password)
+ urllib.urlopen(result_url, data = data)
diff --git a/bot/ircmeeting/meeting.py b/bot/ircmeeting/meeting.py
index b22dac6..a49aaaf 100644
--- a/bot/ircmeeting/meeting.py
+++ b/bot/ircmeeting/meeting.py
@@ -101,6 +101,10 @@ class Config(object):
# Meeting management urls
voters_url = 'http://localhost:3000/users/voters'
agenda_url = 'http://localhost:3000/agendas/current_items'
+ result_url = 'http://localhost:3000/agendas/current_items'
+ # Credentials for posting voting results
+ voting_results_user = 'user'
+ voting_results_password = 'password'
def enc(self, text):
return text.encode(self.output_codec, 'replace')
@@ -342,6 +346,7 @@ class MeetingCommands(object):
for messageline in message.split('\n'):
self.reply(messageline)
self._meetingIsOver = True
+ self.config.agenda.post_result()
def do_topic(self, nick, line, **kwargs):
"""Set a new topic in the channel."""
if not self.isChair(nick): return