Created
February 29, 2012 22:30
-
-
Save spier/1944992 to your computer and use it in GitHub Desktop.
See activity of the network of your repositories (activity as in the latest pushs)
This file contains hidden or 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
#!/usr/bin/env ruby | |
require "rubygems" | |
require "open-uri" | |
require "pp" | |
require "logger" | |
require "json" | |
def get_repositories(user) | |
url = "http://github.com/api/v2/json/repos/show/#{user}" | |
repos = JSON[open(url).read] | |
repos = repos["repositories"] | |
end | |
def get_network(user,repo_name) | |
url = "http://github.com/api/v2/json/repos/show/#{user}/#{repo_name}/network" | |
network = JSON[open(url).read] | |
network = network["network"] | |
end | |
def get_network_changes(network) | |
network_changes = network.map{|n| "#{n["pushed_at"]} #{n["url"]}"} | |
network_changes.sort.reverse[0..5] | |
end | |
# -- MAIN | |
user = "maxogden" | |
repositories = get_repositories(user) | |
repositories.each do |r| | |
network = get_network(r["owner"],r["name"]) | |
puts "#{r["owner"]}/#{r["name"]} :: network = #{network.size}" | |
network_changes = get_network_changes(network) | |
network_changes.each do |nc| | |
puts "\t#{nc}" | |
end | |
end |
This file contains hidden or 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
maxogden/99ATMs :: network = 4 | |
2011/12/18 16:02:48 -0800 https://github.com/maxogden/99ATMs | |
2011/12/12 09:43:52 -0800 https://github.com/videmsky/open-atm.org | |
2011/12/03 16:30:38 -0800 https://github.com/h0ke/99ATMs | |
2011/12/03 14:26:44 -0800 https://github.com/ryanjarvinen/99ATMs | |
maxogden/action :: network = 5 | |
2011/04/02 12:41:06 -0700 https://github.com/quirkey/action | |
2011/04/02 12:41:06 -0700 https://github.com/pjkelly/action | |
2010/12/22 12:59:35 -0800 https://github.com/maxogden/action | |
2010/09/26 08:51:11 -0700 https://github.com/rbriank/action | |
2010/09/26 08:51:11 -0700 https://github.com/FrancisVarga/action | |
maxogden/ADAPDX :: network = 2 | |
2010/10/09 18:27:20 -0700 https://github.com/tjgillies/ADAPDX | |
2010/10/09 18:27:20 -0700 https://github.com/maxogden/ADAPDX | |
maxogden/apns-node :: network = 9 | |
2011/10/20 07:18:32 -0700 https://github.com/mxml/apns-node | |
2011/05/29 22:44:49 -0700 https://github.com/samchandra/apns-node | |
2011/05/29 22:44:49 -0700 https://github.com/neojjang/apns-node | |
2011/05/29 22:44:49 -0700 https://github.com/maxogden/apns-node | |
2011/05/29 22:44:49 -0700 https://github.com/lyhiving/apns-node | |
2011/05/29 22:44:49 -0700 https://github.com/jpoz/apns-node | |
maxogden/autocomplete-search :: network = 1 | |
2011/02/03 13:00:43 -0800 https://github.com/maxogden/autocomplete-search | |
maxogden/bl.ocks.org :: network = 9 | |
2011/07/10 09:57:59 -0700 https://github.com/notmatt/bl.ocks.org | |
2011/07/10 09:57:59 -0700 https://github.com/netconstructor/bl.ocks.org | |
2011/07/10 09:57:59 -0700 https://github.com/mbostock/bl.ocks.org | |
2011/07/10 09:57:59 -0700 https://github.com/leoalassia/bl.ocks.org | |
2011/07/10 09:57:59 -0700 https://github.com/kleinjos/bl.ocks.org | |
2011/07/10 09:57:59 -0700 https://github.com/AndreaSotoa/bl.ocks.org | |
maxogden/blog :: network = 3 | |
2011/12/02 13:20:46 -0800 https://github.com/maxogden/blog | |
2011/07/16 23:58:07 -0700 https://github.com/skunkwerks/blog | |
2010/12/01 13:36:37 -0800 https://github.com/der-harm/blog | |
maxogden/bodyparts :: network = 1 | |
2010/06/22 11:05:31 -0700 https://github.com/maxogden/bodyparts | |
maxogden/bouncy :: network = 16 | |
2012/02/12 19:10:11 -0800 https://github.com/substack/bouncy | |
2012/02/02 14:10:59 -0800 https://github.com/wearefractal/trouncy | |
2012/01/17 03:28:07 -0800 https://github.com/einaros/bouncy | |
2012/01/15 12:37:27 -0800 https://github.com/AgoristRadio/bouncy | |
2011/12/10 15:10:38 -0800 https://github.com/yorickvP/bouncy | |
2011/12/09 11:02:01 -0800 https://github.com/seebees/bouncy | |
maxogden/bubbrubb :: network = 3 | |
2010/10/16 00:07:30 -0700 https://github.com/whoahbot/bubbrubb | |
2010/10/15 18:50:06 -0700 https://github.com/victusfate/bubbrubb | |
2010/10/15 18:50:06 -0700 https://github.com/maxogden/bubbrubb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment