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 "$1" |jq -r '.data.title')
  RATING=$(curl -s "|yyy&fields=engagement&id=$1" | jq -r '.engagement.share_count')
  echo $RATING" || "$TITLE
Sample output (used mostly for adding entries to kb.txt):
$ cs
14399 || RickRoll'D
You should have curl and jq installed and set-up your Facebook API keys to query the REST API.