Skip to content

Instantly share code, notes, and snippets.

@dphiffer
Last active October 4, 2019 14:28
Show Gist options
  • Save dphiffer/5f74a82ae20ffca1cf69320e5961543a to your computer and use it in GitHub Desktop.
Save dphiffer/5f74a82ae20ffca1cf69320e5961543a to your computer and use it in GitHub Desktop.
#!/bin/bash
# Testing out creating a gist using the GitHub API.
# https://developer.github.com/v3/gists/
# Requires a personal access token
# https://github.com/settings/tokens
# https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line
user="dphiffer"
key="[snip]"
curl -u "$user:$key" \
-H "User-Agent: $user" \
-H "Content-Type: application/json" \
-d '{"description": "testing", "public": false, "files": {"test.txt": {"content": "hey there" } } }' \
https://api.github.com/gists
@dphiffer
Copy link
Author

dphiffer commented Oct 4, 2019

This works now! Thanks to Ian Dees!

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