GitHub curl toturial
source ~/extra.bash_aliases
function f {
if [ "$#" -eq 1 ]; then
curl -v -H "Authorization: token $T" https://api.github.com
curl -v -H "Authorization: token $T" -X POST --data '{
"name":"$1",
"has_issues":false,
"has_projects":false,
"has_wiki":false
}' https://api.github.com/user/repos
fi
}
f <REPO_NAME>
unset -f f
curl -sI https://api.github.com/users/$USER/starred?per_page=1
curl -sI https://api.github.com/users/$USER/starred?per_page=1|egrep '^Link'|egrep -o 'page=[0-9]+'|tail -1|cut -c6-
USER=Un1Gfn
alias curl='proxychains curl'
curl "https://api.github.com/users/$USER/starred?sort=created&direction=asc" >/tmp/star
cat /tmp/star \
| jq ' .[] | "\(.full_name) # \(.description)" ' \
| tr -d '"' \
| column -s"#" -t \
| sed '0~2 a\\' \
| less -S
git remote add origin https://Un1Gfn:"$PASSWORD"@gist.github.com/"$ID".git
git remote set-url origin https://Un1Gfn:"$PASSWORD"@gist.github.com/"$ID".git
git clone https://Un1Gfn:"$PASSWORD"@gist.github.com/"$ID".git
git remote add origin git@gist.github.com:"$ID".git
git remote set-url origin git@gist.github.com:"$ID".git
git clone git@gist.github.com:"$ID".git
curl https://api.github.com/users/Un1Gfn/gists | jq ' .[] | "\(.html_url) \(.files[].filename)" '
curl -v -H "Authorization: token $T" https://api.github.com
curl -X DELETE -H "Authorization: token $T" https://api.github.com/repos/Un1Gfn/del
curl -X DELETE -H "Authorization: token $T" https://api.github.com/gists/<ID>
curl -v https://api.github.com/repos/stedolan/jq/commits?per_page=5
curl -v https://api.github.com/repos/stedolan/jq/commits?per_page=5 >json