Skip to content

Instantly share code, notes, and snippets.

@sonsongithub
Last active November 14, 2015 08:59
Show Gist options
  • Select an option

  • Save sonsongithub/1c6b87c74c272e3d8d08 to your computer and use it in GitHub Desktop.

Select an option

Save sonsongithub/1c6b87c74c272e3d8d08 to your computer and use it in GitHub Desktop.
octokit convert Issue list to wiki page.
require 'octokit'
client = Octokit::Client.new(:access_token => "")
user = client.user
puts user.login
page = 1
issues = []
for i in 1..20
puts page
array = client.list_issues("sonsongithub/reddift", {:page=>page})
issues = issues + array
break if array.length == 0
page = page + 1
end
categories = {}
issues.each{|issue|
item = {
:title => issue.title,
:body => issue.body,
:label => issue.labels[0].name,
:future => (issue.milestone.title == "Future")
}
begin
categories[issue.labels[0].name].push(item)
rescue
categories[issue.labels[0].name] = [item]
end
}
categories.each_pair{|key, value|
puts "### #{key}"
puts "Path | Info| Support "
puts "----------|---------|---------"
value.each{|item|
support = item[:future] ? "No plan" : "ver 1.5"
puts "#{item[:title]}|[reddit.com](#{item[:body]})|#{support}"
}
puts ""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment