This repository was archived by the owner on Oct 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathgithub-stars.sh
More file actions
executable file
·62 lines (52 loc) · 1.55 KB
/
github-stars.sh
File metadata and controls
executable file
·62 lines (52 loc) · 1.55 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/zsh
#
# Script to get stars from our repositories for our KPI Dashboard
#
# You can get your token at https://github.com/settings/tokens with scopes "repo > public_replo" only if you are getting the stars only for public repositories. Give full "repo" scope for public & private ones.
#
# Configure a global variable named GITHUB_USERNAME with your GitHub username
# Configure a global variable named GITHUB_STARS_TOKEN with the token you just created
#
org="mindee"
repos=(
"demo-Nodejs-SDK"
"demo-plates-DVLA"
"demo-Python-SDK"
"devrel"
"doctr"
"doctr-tfjs-demo"
"integration-microsoft-flow"
"integration-zapier"
"mindee-api-java"
"mindee-api-nodejs"
"mindee-api-python"
"mindee-api-ruby"
"notebooks"
"Problem-of-BatchNorm"
"react-mindee-js"
"tf-builds"
"vue-mindee-js"
)
###################################
# Do not modify beyong this point #
###################################
api_url="https://api.github.com/repos/"
bold=$(tput bold)
normal=$(tput sgr0)
printf "\n%s\n" "----------------------"
echo "| Repositories Stars |"
printf "%s\n" "----------------------"
# looping the repos
total_stars=0
for repo in "${repos[@]}"
do
stars=$(curl --silent -u $GITHUB_USERNAME:$GITHUB_STARS_TOKEN "$api_url$org/$repo" | jq '.stargazers_count')
printf "%s\n" "${bold}$repo:${normal} $stars"
excel="$excel$stars,"
total_stars=$(($total_stars+$stars))
done
printf "\n\n%s\n" $total_stars
printf "\n\n%s\n" "-------------"
echo "| Excel CSV |"
printf "%s\n" "-------------"
echo "$excel"