Created
May 24, 2021 10:51
-
-
Save tyjak/e4eb7bf3ed820cbd24b2be1da71f1068 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# GistID: e4eb7bf3ed820cbd24b2be1da71f1068 | |
# Get text of the first result of a wikipedia search as argument | |
# Dependencies: http, jq, sed | |
http https://fr.wikipedia.org/w/api.php\?format\=json\&action\=query\&generator\=search\&gsrsearch\=$1\&gsrlimit\=1\&prop\=extracts\&explaintext\=1 | jq '.query.pages | map(values) | .[0].extract' | sed 's/\\n/\n/g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment