summaryrefslogtreecommitdiff
path: root/Biz/Dragons/get-examples.sh
blob: d488fe97f6f2b51185b596293f9436a49c6afc10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
#
##
  if [ "$#" == "0" ]
  then
    echo "usage: $(basename "$0") <cookie>"
    echo "copy the cookie from the browser dev console"
    exit 1
  else
    cookie="$1"
    if curl 'https://dragons.dev/analysis' \
      -d "owner=github&repo=training-kit" \
      -X POST \
      -H 'Content-Type: application/x-www-form-urlencoded' \
      -H "Cookie: JWT-Cookie=$cookie" \
      --silent \
      --compressed
    then
      echo okay
      exit 0
    else
      echo error
      exit 1
    fi
  fi
##