@@ -0,0 +1,992 @@
+import requests%0Aimport urllib.parse%0A%0Aclass Plugin:%0A    def __call__(self, bot):%0A        bot.on_respond(r%22news(?: about (.*))?$%22, self.on_respond)%0A        bot.on_help(%22news%22, self.on_help)%0A%0A    def on_respond(self, bot, msg, reply):%0A        topic = msg%5B%22match%22%5D%5B0%5D%0A        if topic:%0A            url = %22https://ajax.googleapis.com/ajax/services/search/news?v=1.0&rsz=5&q=%7B0%7D%22.format(urllib.parse.quote(topic))%0A        else:%0A            url = %22https://ajax.googleapis.com/ajax/services/search/news?v=1.0&rsz=5&topic=h%22%0A%0A        headers = %7B %22User-Agent%22: %22SmartBot%22 %7D%0A%0A        res = requests.get(url, headers=headers).json()%0A        for i, story in enumerate(res%5B%22responseData%22%5D%5B%22results%22%5D%5B:3%5D):%0A            title = story%5B%22titleNoFormatting%22%5D.replace(%22&#39;%22, %22'%22).replace(%22%60%22, %22'%22).replace(%22&quot;%22, %22%5C%22%22)%0A            link = story%5B%22unescapedUrl%22%5D%0A            reply(%22%5B%7B0%7D%5D: %7B1%7D - %7B2%7D%22.format(i, title, link))%0A%0A    def on_help(self, bot, msg, reply):%0A        reply(%22Syntax: news %5Babout %3Ctopic%3E%5D%22)%0A

Add news plugin