Categories
php webdev

Export GitHub issues as CSV with v3 API

That’s a very little snipplet/hack to retrieve the issue with curl and php. If you have time take a look to the official GitHub v3 API to create something better ;)
[code]
curl -u “:user” https://api.github.com/repos/:user/:repo/issues?per_page=1000 > issue.json
[/code]
note that I have to use per_page parameter because since v3 API all the results are all paginated by 30. I used CuRL externally from php (I’m lazy) but you can implement the API call as you like.

Then create a php file like this:

[code]
milestone->title.”;”.$i->number.”;”.$i->state.”;”.$i->title.”;”.$i->body.”\n\r”;
}
?>
[/code]

and execute it to have issues on a csv file

[code]
php issues.php > issues.csv
[/code]

That’s all!