Skip to content

Instantly share code, notes, and snippets.

@Vall3y
Last active December 21, 2015 15:39
Show Gist options
  • Save Vall3y/3ecceb9a311a249c84ce to your computer and use it in GitHub Desktop.
Save Vall3y/3ecceb9a311a249c84ce to your computer and use it in GitHub Desktop.
require 'nokogiri'
date = '2015-11-01'
members = ['shiloa', 'Vall3y', 'natashach', 'edencoh', 'naorrosenberg',
'benbek']
def get_issues_count(author, assignee, date)
url = "https://github.com/quixey/app-portal/issues?utf8=%E2%9C%93&q=assignee%3A#{assignee}++created%3A%3E#{date}+author%3A#{author}+&_pjax=%23js-repo-pjax-container"
cookie = 'your cookie'
output = `curl -b "#{cookie}" "#{url}" `
doc = Nokogiri::HTML(output)
issues = doc.xpath('//*[@class="table-list-cell issue-title"]')
issues.length
end
output = []
members.each do |assignee|
total = 0
members.each do |author|
issues_count = get_issues_count(author, assignee)
total += issues_count
output << "#{author} assigned #{issues_count} Pull Requests to #{assignee}"
end
output << "Total assigned to #{assignee}: #{total}"
end
puts "Statistics since #{date}"
output.each { |line| puts line }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment