如何在github组织中找到最大的已加星标的项目

时间:2015-02-08 08:45:12

标签: github

如何在包含多个跨越多个页面的项目的github组织中找到最大加星标项目(即最受欢迎的项目)(例如https://github.com/foo

1 个答案:

答案 0 :(得分:0)

GitHub网页用户界面仅在your Starred Projects page上提供可排序的星标(请参阅sortable stars

为了让您获得GitHub API以便:

有点like this ruby script

repos.each do |r|
  user, repo = r.split "/"
  info = nil

  # たまに404があったりするので適当にrescue
  begin
    info = Github.repos.find user, repo
  rescue
    next
  end
  count = info["stargazers_count"]
  result["#{r}"] = count
end

# スター数が多い順にソートして出力
# Sort order most Stars to output
result.sort_by{|k, v| -v}.each do |k, v|
  printf "%4d: #{k}\n", v
end 
相关问题