Last active
December 21, 2015 15:39
-
-
Save Vall3y/3ecceb9a311a249c84ce to your computer and use it in GitHub Desktop.
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
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