Skip to content

Instantly share code, notes, and snippets.

@aerosol
Created December 20, 2019 23:14
Show Gist options
  • Save aerosol/5115dd1ad36b620bbd05b303771f7f09 to your computer and use it in GitHub Desktop.
Save aerosol/5115dd1ad36b620bbd05b303771f7f09 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
url1="https://en.bab.la/dictionary/english-polish/$1"
url2="https://en.bab.la/dictionary/polish-english/$1"
shoot() {
curl -s $1 | pup 'div.content > div > div > div > ul.sense-group-results > li a text{}' 2>&1 |
awk 'NF' | head -n 3 | grep -v EOF
}
cat <(shoot $url1) <(shoot $url2) | sort | uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment