@@ -0,0 +1,2570 @@
+package org.dstadler.github;%0A%0Aimport com.google.common.collect.Multimap;%0Aimport com.google.common.collect.TreeMultimap;%0Aimport org.apache.commons.io.FileUtils;%0Aimport org.apache.commons.lang3.StringUtils;%0Aimport org.dstadler.github.search.BaseSearch;%0Aimport org.dstadler.github.util.JSONWriter;%0Aimport org.dstadler.github.util.Stats;%0Aimport org.kohsuke.github.GHRepository;%0Aimport org.kohsuke.github.GitHub;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.util.Comparator;%0Aimport java.util.HashSet;%0Aimport java.util.List;%0Aimport java.util.Set;%0A%0Apublic class ListStars %7B%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        File%5B%5D files = Stats.getFiles();%0A%0A        Set%3CString%3E repositories = readLines(files);%0A        System.out.println(%22Found %22 + repositories.size() + %22 repositories using Apache POI%22);%0A%0A        Multimap%3CInteger, String%3E starsAndRepositories = createSortedMultimap();%0A%0A        GitHub github = BaseSearch.connect();%0A%0A        int count = 0;%0A        for (String repository : repositories) %7B%0A            try %7B%0A                GHRepository repo = github.getRepository(repository);%0A                starsAndRepositories.put(repo.getStargazersCount(), repository);%0A%0A                count++;%0A                if (count %25 10 == 0) %7B%0A                    System.out.println(count + %22: %22 + repository + %22: %22 + repo.getStargazersCount() + %22 - %22 +%0A                            StringUtils.abbreviate(starsAndRepositories.toString(), 1024));%0A                %7D%0A            %7D catch (IOException e) %7B%0A                starsAndRepositories.put(-1, repository);%0A                System.out.println(repository + %22: %22 + e);%0A            %7D%0A        %7D%0A%0A        System.out.println(%22Stars: %22 + starsAndRepositories + %22: %22 +%0A                StringUtils.abbreviate(starsAndRepositories.toString(), 1024));%0A    %7D%0A%0A    private static Multimap%3CInteger, String%3E createSortedMultimap() %7B%0A        Comparator%3CInteger%3E intSort = Comparator.naturalOrder();%0A        return TreeMultimap.create(intSort.reversed(), Comparator.naturalOrder());%0A    %7D%0A%0A    private static Set%3CString%3E readLines(File%5B%5D files) throws IOException %7B%0A        Set%3CString%3E repositories = new HashSet%3C%3E();%0A        for(File file : files) %7B%0A            List%3CString%3E lines = FileUtils.readLines(file, %22UTF-8%22);%0A%0A            for (String line : lines) %7B%0A                JSONWriter.Holder holder = JSONWriter.mapper.readValue(line, JSONWriter.Holder.class);%0A%0A                repositories.addAll(holder.getRepositoryVersions().values());%0A            %7D%0A        %7D%0A%0A        return repositories;%0A    %7D%0A%7D%0A

Add script which uses a simple loop of fetching stars of repositories