plugin.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:globibot 作者: best-coloc-ever 项目源码 文件源码
def fetch_definitions(self, term):
        url = url_concat(UrbanDictionary.DEFINE_URL, dict(term=term))
        request = HTTPRequest(
            url     = url,
            headers = {
                'X-Mashape-Key': self.api_key,
                'Accept'       : 'text/plain'
            }
        )
        tornado_future = self.client.fetch(request)
        future = to_asyncio_future(tornado_future)
        response = await future

        data = json_decode(response.body)

        return data['list']
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号