Created
February 13, 2015 02:04
-
-
Save pdehaan/804ed3b472030402cf2d to your computer and use it in GitHub Desktop.
Grab public user Gists using JavaScript
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
'use strict'; | |
var GitHubApi = require('github'); | |
var github = new GitHubApi({ | |
version: "3.0.0" | |
}); | |
github.gists.getFromUser({ | |
user: 'pdehaan', | |
page: 1, | |
per_page: 100 | |
}, function (err, gists) { | |
if (err) { | |
return console.error(err); | |
} | |
// console.log(JSON.stringify(data, null, 2)); | |
gists.forEach(function (gist) { | |
console.log('[%s] %s (%s)', gist.id, gist.description || '', new Date(gist.updated_at).toLocaleDateString()); | |
Object.keys(gist.files).map(function (file) { | |
return gist.files[file]; | |
}).forEach(function (file) { | |
console.log(' - %s (%s)', file.filename, file.language); | |
}); | |
}); | |
}); |
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
[804ed3b472030402cf2d] Grab public user Gists using JavaScript (Thursday, February 12, 2015) | |
- index.js (JavaScript) | |
- output.txt (Text) | |
[6aaa8856ad1e5c0227a4] (Friday, May 09, 2014) | |
- gistfile1.js (JavaScript) | |
[10438005] Scan your Firefox bookmarks exported JSON for HTTPS bookmarks succeptable to heartbleed exploit (Thursday, April 10, 2014) | |
- index.js (JavaScript) | |
[7346857] Start a server on port 8000 using Grunt. (Wednesday, November 06, 2013) | |
- Gruntfile.js (JavaScript) | |
[7343753] Quickly check for the existence of a specific copyright header in a project using a custom Grunt task. (Wednesday, November 06, 2013) | |
- Gruntfile.js (JavaScript) | |
[3805175] ExamplesRSS (Saturday, September 29, 2012) | |
- examples.rss (XML) | |
[3560452] DataView scroll to top #senchatouch (Friday, August 31, 2012) | |
- scrollTo.html (HTML) | |
[1241352] Twitter Bootstrap "label" example. (Sunday, September 25, 2011) | |
- bootstrap_labels.html (HTML) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment