Create a bash function with parameters

In the below example I'll create a function that will take an URL as parameter and query it's stats from 3rd party REST APIs. Add to ~/.bashrc:

function cs() {
  TITLE=$(curl -s "cli.fyi/$1" |jq -r '.data.title')
  RATING=$(curl -s "https://graph.facebook.com/?access_token=xxx|yyy&fields=engagement&id=$1" | jq -r '.engagement.share_count')
  echo $RATING" || "$TITLE
}
Sample output (used mostly for adding entries to kb.txt):
$ cs https://www.youtube.com/watch?v=oHg5SJYRHA0
14399 || RickRoll'D
You should have curl and jq installed and set-up your Facebook API keys to query the REST API.