Created
May 20, 2013 18:15
-
-
Save macmartine/5614125 to your computer and use it in GitHub Desktop.
Deletes all of a users' gists
This file contains 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
#!/usr/bin/env ruby | |
require 'json' | |
# Remove all gists from a user | |
# Must be run repeatedly, as one request returns a maximum of 30 results | |
# Feel free to alter this to keep making requests until there are no more gists, | |
# but for my purposes this was sufficient | |
username = "username" | |
password = "password" | |
value = `curl --user \"#{username}:#{password}\" https://api.github.com/users/#{username}/gists` | |
JSON.parse(value).each do |i| | |
puts i['url'] | |
`curl --user "#{username}:#{password}" -X DELETE #{i['url']}` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment