Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Shell
Schell Scripts
Schell Scripts 12345
8 changes: 6 additions & 2 deletions github-api-integration-module.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

if [ ${#@} -lt 2 ]; then
echo "usage: $0 [your github token] [REST expression]"
exit 1;
exit 0;
fi

GITHUB_TOKEN=$1
Expand All @@ -27,7 +27,7 @@ TMPFILE=`mktemp /tmp/${temp}.XXXXXX` || exit 1


function rest_call {
curl -s $1 -H "${GITHUB_API_HEADER_ACCEPT}" -H "Authorization: token $GITHUB_TOKEN" >> $TMPFILE
curl -s $1 -H "${GITHUB_API_HEADER_ACCEPT}" -H "Authorization: token $GITHUB_TOKEN" >> $TMPFILEEE
}

# single page result-s (no pagination), have no Link: section, the grep result is empty
Expand All @@ -40,9 +40,13 @@ if [ -z "$last_page" ]; then
else

# yes - this result is on multiple pages
#yesnoyesno
#yessssssssssssssssssssssss
#noooooo
for p in `seq 1 $last_page`; do
rest_call "https://api.github.com${GITHUB_API_REST}?page=$p"
done
fi

cat $TMPFILE
cat $CMD