require 'utils/json'

GitHub.open "https://api.github.com/legacy/repos/search/homebrew" do |f|
  Utils::JSON.load(f.read)["repositories"].each do |repo|
    if repo['name'] =~ /^homebrew-(\S+)$/
      puts tap = if repo['username'] == "Homebrew"
        "homebrew/#{$1}"
      else
        repo['username']+"/"+$1
      end
    end
  end
end

require "utils/json"

GitHub.open("https://api.github.com/search/repositories?q=homebrew+sort:stars&per_page=100") do |json|
  json["items"].each do |repo|
    if repo["name"] =~ /^homebrew-(\S+)$/
      user = repo["owner"]["login"]
      user = user.downcase if user == "Homebrew"
      puts "#{user}/#{$1}"
    end
  end
end

Fix ls-taps for v3 API
Fix ls-taps for v3 API

This doesn't handle paginated results, but it fetches the 100 most
starred results so that's probably good enough for now.

Fixes #26566.
