@@ -0,0 +1,1774 @@
+#! /usr/bin/env python%0A# coding:utf-8%0A%0A%0Aimport abc%0Afrom logging import getLogger%0A%0A%0Aclass Module(metaclass=abc.ABCMeta):%0A    %22%22%22%0A    message %E3%81%AE%E5%BD%A2%E5%BC%8F%0A    message:%0A        %22id%22%0A        %22text%22%0A        %22user%22:%0A            %22name%22%0A            %22screen_name%22%0A    %22%22%22%0A    def is_fire(self):%0A        return True%0A%0A    @abc.abstractmethod%0A    def reses(self, message, master):%0A        pass%0A%0A%0Aclass Kovot:%0A%0A    def __init__(%0A        self,%0A        target,%0A        stream,%0A        master,%0A        logger=None%0A    ):%0A        self.target = target%0A        self.stream = stream%0A        self.master = master%0A        self.logger = logger if logger else getLogger(__file__)%0A        self.modules = %5B%5D%0A%0A    def is_message(self, message):%0A        %22%22%22%0A        Check essage format:%0A            %22id%22%0A            %22text%22%0A            %22user%22:%0A                %22name%22%0A                %22screen_name%22%0A        %22%22%22%0A        return (%0A            %22text%22 in message and%0A            %22user%22 in message and%0A            %22id%22 in message and%0A            %22name%22 in message%5B%22user%22%5D and%0A            %22screen_name%22 in message%5B%22user%22%5D%0A        )%0A%0A    def add_module(self, module):%0A        self.modules.append(module)%0A%0A    def reses(self, message):%0A        modules = %5Bmodule for module in self.modules if module.is_fire()%5D%0A        reses = %5B%5D%0A        for module in modules:%0A            reses.extend(module.reses(message, self.master))%0A        return reses%0A%0A    def run(self):%0A        for message in self.stream:%0A            if not self.is_message(message):%0A                continue%0A            elif self.stream.is_tweet_needed(message):%0A                reses = self.reses(message)%0A%0A                self.stream.say(%0A                    message,%0A                    sorted(reses, reverse=True),%0A                    num=5%0A                )%0A

Add kovot.py