예제 #1
0
    def GET(self, name):
        url = "http://en.wikipedia.org/wiki/" + name
        preview = wikisnip.wikisnip(url).prettify()

        web.header('Content-Type', 'text/html; charset=utf-8')
        yield '<htm>'
        yield '<head><title>%s</title><link rel="stylesheet" type="text/css" href="/static/style.css"/></head>' % name
        yield '<body>'
        yield preview
        yield '</body></html>'
예제 #2
0
파일: whatis.py 프로젝트: dcordoba/WhatIs
def get_wiki_page(query):
	base_url = "http://en.wikipedia.org/wiki/"+urllib.quote(query)
	page = wikisnip.wikisnip(base_url).prettify
	print page