Show HN: Wiki – Command-line tool to fetch summaries from Wikipedia
1–10 of 10 posts
Re: Show HN: Wiki – Command-line tool to fetch summaries from Wikipedia
#2Re: Show HN: Wiki – Command-line tool to fetch summaries from Wikipedia
#3 curl -s "https://en.wikipedia.org/w/api.php?action=parse&contentmodel=wikitext&format=json&redirects&explaintext&prop=text§ion=0&page=golang" | jq .parse.text.\"*\" > temp.html; links temp.html
(Scroll that). Not quite the same, but...Re: Show HN: Wiki – Command-line tool to fetch summaries from Wikipedia
#4Construct a query with predicate as http://dbpedia.org/ontology/abstract and you have your summary.
Re: Show HN: Wiki – Command-line tool to fetch summaries from Wikipedia
#5Re: Show HN: Wiki – Command-line tool to fetch summaries from Wikipedia
#6That's a lot of code. curl -s "https://en.wikipedia.org/w/api.php?action=parse&contentmodel=wikitext&format=json&redirects&explaintext&prop=text§ion=0&page=golang" | jq .parse.text.\"*\" > temp.html; links temp.html (Scroll that). Not quite the same, but...
my osx install does not seem to have these things.
Re: Show HN: Wiki – Command-line tool to fetch summaries from Wikipedia
#7That's a lot of code. curl -s "https://en.wikipedia.org/w/api.php?action=parse&contentmodel=wikitext&format=json&redirects&explaintext&prop=text§ion=0&page=golang" | jq .parse.text.\"*\" > temp.html; links temp.html (Scroll that). Not quite the same, but...
jq? links? my osx install does not seem to have these things.
[edit: typo]
Re: Show HN: Wiki – Command-line tool to fetch summaries from Wikipedia
#8That's a lot of code. curl -s "https://en.wikipedia.org/w/api.php?action=parse&contentmodel=wikitext&format=json&redirects&explaintext&prop=text§ion=0&page=golang" | jq .parse.text.\"*\" > temp.html; links temp.html (Scroll that). Not quite the same, but...
jq? links? my osx install does not seem to have these things.
Re: Show HN: Wiki – Command-line tool to fetch summaries from Wikipedia
#9That's a lot of code. curl -s "https://en.wikipedia.org/w/api.php?action=parse&contentmodel=wikitext&format=json&redirects&explaintext&prop=text§ion=0&page=golang" | jq .parse.text.\"*\" > temp.html; links temp.html (Scroll that). Not quite the same, but...
bashwiki() {
links -dump "https://en.wikipedia.org/wiki/$@" | head -n 60
}
And call it with `$ bashwiki golang` and you get the summary (and some of the other text). My guess is that someone a little more familiar with bash could strip the extra output and make it a bit nicer though.As they say "to each his own" :)
Re: Show HN: Wiki – Command-line tool to fetch summaries from Wikipedia
#10Nice, would be interesting to have a shorter version. Maybe until the first dot?