Hacker News new | ask | show | jobs
by okasaki 3736 days ago

    >>> import requests, bs4
    >>> def summary(name):
    ...     resp = requests.get("https://en.wikipedia.org/wiki/{0}".format(name))
    ...     return bs4.BeautifulSoup(resp.text).p.get_text()
    ... 
    >>> summary("Hacker news")
    'Hacker News is a social news website focusing on computer science and entrepreneurship. It is run by Paul Graham\'s investment fund and startup incubator, Y Combinator. In general, content that can be submitted is defined as "anything that gratifies one\'s intellectual curiosity".[1]'