Skip to content

Instantly share code, notes, and snippets.

@gorshkov-leonid
Created September 8, 2021 15:44
Show Gist options
  • Save gorshkov-leonid/43b8048bf378223e675f70d463d7fbdd to your computer and use it in GitHub Desktop.
Save gorshkov-leonid/43b8048bf378223e675f70d463d7fbdd to your computer and use it in GitHub Desktop.
gitlab api
#!/bin/bash
i=0

while [[  ! $S == *[] ]]
  do
    (( i++ ))
    S=$(curl -s -k 'https://gitlab.com/api/v4/projects/17678/repository/branches?private_token=<my-access-token>&page='$i)
	echo "$S" | jq > $i.json
	echo "$S" | wc
    
  done  
  
# jq -s '.[0] + .[1] + .[2] + .[3] + .[4] + .[5] + .[6] + .[7] + .[8] + .[9] + .[10] + .[11]' 1.json 2.json 3.json 4.json 5.json 6.json 7.json 8.json 9.json 10.json 11.json 12.json  > all.json
# jq '[.[] | {name, committed_date: .commit.committed_date}] | sort_by(.committed_date)' all.json > processed.json
@gorshkov-leonid
Copy link
Author

#!/bin/bash
i=0
while [ $i -lt 100 ]
do
  i=$(( $i + 1 ))
  touch "$i.txt"
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment