11 ms·
Show HN: Terminal Based Wikipedia
- JaDogg 4y agoThank you for adding the screenshots. Looks good.
- bitigchi 4y agoNeeds a pager, otherwise looks great!
- johannes1234321 4y agoBut please don't build a custom pager, but use $PAGER (unless this is supposed to turn into a full browser ...) so it works as expected (key bindings etc )
- wkat4242 4y agoIndeed and it would be so much better to use termcap (eg through ncurses) instead of blasting ANSI codes without checking :) some of us still use terminals
- supriyo-biswas 4y agoWhy do the screenshots show some sort of syntax highlighting applied to the article text?
- super256 4y agoLooks like syntax highlighting from the shell. (Text between quotation marks being highlighted, numbers and key words like "for", "and", "in", "create", "as", "or".)
- 0xfafafa 4y agoThe images were generated by carbon and it's auto syntax selection must have defined the whole thing to be shell code. I'll fix it in next commit. Thanks pointing it out.
- anigbrowl 4y agoIts actually kinda neat...
- photochemsyn 4y agoLooks good. Access to the revision history for each page would be a nice feature that might work well in the terminal.
- deleted 4y ago[deleted]
- lexhart 4y agoThe execution is really nice! But,there are already browsers and web guidelines to make this possible without specific single purpose apps. Why would I use this over for example, Lynx?
- 0xfafafa 4y agoI have never used Lynx personally, but just going through the description of it i would say that wik also provide quick introduction lookup to a desired topic. Initially i made this as a personal tool just for this quick introduction lookup feature as i don't wanted to hustle through a browser for a just introduction search on the topic. But when made i made this project public i added full info and search.
- capitainenemo 4y agoI was kinda wondering that myself. There's so many terminal based apps to keep track of, I've gotten into the habit of trying to know a core set fairly well (like bash,awk,sed,grep -P etc). For this sort of thing I have a dozen tabs open in w3m already. $ alias wiki='f(){ w3m -F "https://en.wikipedia.org/w/index.php?search=${1}&title=Special:Search&ns0=1"; unset -f f; }; f' $ wiki pandas This seemed to work well for me. A tab to the wikipedia search page bookmarked would work well too and could be used in existing w3m/lynx session.
- capitainenemo 4y agoOh, BTW, this sort of thing works well with any sort of site that degrades gracefully/is not pure JS. $ alias crate='f(){ w3m -F "https://lib.rs/search?q=${1}"; unset -f f; }; f' $ crate rocket (lib.rs is a crate index using rust as the server instead of javascript, and has advantage of working well with terminal browsers)
- SoftTalker 4y agoThis is the Unix way. You already have the tools and utilities you need, just pipeline them together and make an alias if it’s something you need frequently.
- 4y ago
- davidgerard 4y agocool! Is this scraping the HTML pages, or fetching the wikitext through the API and rendering it?
- nic-waller 4y agoIt appears to be scraping HTML pages. https://github.com/yashsinghcodes/wik/blob/main/wik/info.py#L50 https://github.com/yashsinghcodes/wik/blob/main/wik/info.py#...
- justsomehnguy 4y agocat /bin/wik #!/bin/sh lynx https://en.wikipedia.org/w/index.php?search=$1
- HervalFreire 4y agoSeems like programmers like the terminal aesthetic. The only real improvement is speed at the cost of memorizing a new key stroke interface for every app. Every other aspect of terminal interfaces is a downgrade. The cost of memorization is also a huge burden I feel there's got to be a better way that gets the best of both worlds.
- yesenadam 4y agoSounds good.. although this comes to mind: https://xkcd.com/927/ https://xkcd.com/927/ (How standards proliferate) Even if you found a better way, the world might just end up with yet another set of keystrokes to memorize.
- pmoriarty 4y agoIn Emacs this can be done with emacs-w3m or eww.
- realworldperson 4y ago[dead]
- ukuina 4y agoThis is neat! Very useful to be able to pipe stdout to other tools like command-line summarization via LLMs.
- fishywang 4y agoLooks nice but a few things are a bit confusing: 1. I'm not sure what's the difference between -i and -s, they seem to work the same for a few examples I tried 2. It renders every paragraph in a different color, which seems... unnecessary 3. There's a [-] at the beginning of every paragraph which I'm not sure what it is for (seems to suggest that it is to fold the paragraph but I don't really see how to actually fold it).
- fantasticfears 4y agoIs there an infobox display?
- bawolff 4y agoWikipedia actually did something similar as an april fools joke one year https://en.wikipedia.org/wiki/Wikipedia:Wikipedia_Signpost/2016-04-01/Technology_report https://en.wikipedia.org/wiki/Wikipedia:Wikipedia_Signpost/2... https://meta.wikimedia.org/wiki/Telnet_gateway https://meta.wikimedia.org/wiki/Telnet_gateway
- neverrroot 4y agoNice one, thank you!
- xigency 4y agoIs there any plan for navigating sections or fetching specific data from the article? For example, a command to print Demographics or Population Density for a specific country.
- qwerty456127 4y agoDoes this work on all major platforms including Windows Terminal?
- snvzz 4y ago>beautifulsoup Really? Seriously? No better way to query the source of a page and render it on the terminal?
- rjh29 4y agoParsing wikitext is insanely hard. Using HTML is a good compromise. See also: * https://github.com/spencermountain/wtf_wikipedia#ok-first- https://github.com/spencermountain/wtf_wikipedia#ok-first- * https://osr.cs.fau.de/wp-content/uploads/2017/09/wikitext-parser.pdf https://osr.cs.fau.de/wp-content/uploads/2017/09/wikitext-pa... * https://utcc.utoronto.ca/~cks/space/blog/programming/ParsingWikitext https://utcc.utoronto.ca/~cks/space/blog/programming/Parsing...
- snvzz 4y agoWow. Much worse than I thought. If only if mediawiki (php) never happened. Wikipedia was sane at one point.
- chris_wot 4y agoDoes it show footnoted references?