Skip to content

Instantly share code, notes, and snippets.

@fracek
Created December 23, 2012 12:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fracek/4363130 to your computer and use it in GitHub Desktop.
Save fracek/4363130 to your computer and use it in GitHub Desktop.
Save the current open issues for the given repository
#!/usr/bin/env node
var github = require('octonode');
function link_to(text, url) {
return '['+text+']('+url+')';
}
var client = github.client();
var repo_name = process.argv[2];
var repo = client.repo(repo_name);
repo.issues(function(err, body, status) {
var issues_url = 'https://github.com/' + repo.name + '/issues/';
console.log('# ' + link_to('Issues for '+ repo.name, issues_url) + '\n');
for (i = 0; i < body.length; i++) {
var issue = body[i];
console.log('## ' + link_to(issue.title, issue.html_url));
console.log('_Opened by ' + issue.user.login + '_\n');
console.log(issue.body);
}
});
// vim: ft=javascript
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment