Hacker News new | ask | show | jobs
by _toastie 3735 days ago
Yeah, kind of sad that this is an April Fool's joke and not a serious interface. I would love to be able to quickly look stuff up from the terminal.
4 comments

    >>> 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]'
It may be a joke, but it actually works:

$ telnet telnet.wmflabs.org Trying 208.80.155.160... Connected to telnet.wmflabs.org. Escape character is '^]'.

(I had some more text pasted here, but it didn't format well on HN)

I've tried a few queries, and it seems to work. Though I did just get an article in French for some reason...

I was hoping that telnet was making a comeback. It feels like an old friend.
Its called ssh. Telnet is pretty much dead to me.
Yes and no.

Telnet is perhaps the internet's debugger.

While the most common use was to access a CLI Somewhere, most of the "traditional" internet protocols can be operated via telnet.

Note btw that there is no login needed to access this "joke". Just enter the address and presto.

SSH is a single use tool in comparison.

html2text and a bash function seem to do okay.

  $ sudo apt-get install html2text

  $ function lookup() {curl -sL http://wikipedia.com/wiki/$1|html2text -ascii|less;}

  $ lookup node.js
Edit: Replace spaces with underscores for multi word lookups, like George_Washington. Or fix the function.