require 'nokogiri' | |
require 'octokit' | |
require 'open-uri' | |
github = Octokit::Client.new(:access_token => ENV['GH_TOKEN']) | |
doc = Nokogiri::HTML.fragment(open('https://github.com/imathis/octopress/wiki/3rd-Party-Octopress-Themes').read) | |
doc.search('table tr td:first a:first').map do |a| | |
a['href'] =~ %r{https?://github.com/([^/]+)/([^?/]+)(\?|$|/)} && [$1, $2] | |
end.compact.map do |owner, repo_name| | |
begin | |
github.repository(:owner => owner, :name => repo_name) | |
rescue Octokit::NotFound | |
end | |
end.compact.sort_by { |repo| -repo.stargazers_count }.each do |repo| | |
puts "#{repo.html_url} - #{repo.stargazers_count}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
As of 08/13/2014, here are the results from running this script: