daily pastebin goal
12%
SHARE
TWEET

Script search-wiki

lollo78 Jun 11th, 2018 71 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. #!/bin/bash
  2. lang=$(echo $1 | cut -f1 -d '-')
  3. text=$2
  4. query=${text// /_}
  5. json=$(curl -sS "https://$lang.wikipedia.org/w/api.php?action=opensearch&search=$query&limit=1&namespace=0&format=json")
  6. descrquote=$(echo $json | sed -r 's/([^,]*,){2}//' | cut -f1 -d ']')
  7. descr=${descrquote//\"/}
  8. echo "Msg:"${descr//[/}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top