Last active
October 4, 2019 14:28
-
-
Save dphiffer/5f74a82ae20ffca1cf69320e5961543a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This works now! Thanks to Ian Dees!