Last active
August 29, 2015 14:05
-
-
Save a-warner/60afe3ffdd0872719247 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' | |
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
As of 08/13/2014, here are the results from running this script: