Created
January 25, 2016 19:42
-
-
Save matiaskorhonen/3e028e2f02dedcabdf58 to your computer and use it in GitHub Desktop.
Quick and dirty script to find empty and otherwise suspect repos
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
| require "json" | |
| require "octokit" | |
| json = '["https://github.com/gophergala2016/webrtc-tab-share","https://github.com/gophergala2016/addit","https://github.com/gophergala2016/smart_app","https://github.com/gophergala2016/netsailor","https://github.com/gophergala2016/kong","https://github.com/gophergala2016/Batit-Project","https://github.com/gophergala2016/Go-Serve","https://github.com/gophergala2016/Festival","https://github.com/gophergala2016/fireup","https://github.com/gophergala2016/globegala","https://github.com/gophergala2016/gHorcrux","https://github.com/gophergala2016/papercast","https://github.com/gophergala2016/openlandings","https://github.com/gophergala2016/gopherlay","https://github.com/gophergala2016/standup-bot","https://github.com/gophergala2016/gongeries","https://github.com/gophergala2016/wwcdc_01","https://github.com/gophergala2016/syamp","https://github.com/gophergala2016/AngryGophers","https://github.com/gophergala2016/klaster","https://github.com/gophergala2016/didactic-octo-chainsaw","https://github.com/gophergala2016/eat-the-gopher","https://github.com/gophergala2016/mailhook","https://github.com/gophergala2016/gophers","https://github.com/gophergala2016/hugoku","https://github.com/gophergala2016/bitx","https://github.com/gophergala2016/gov","https://github.com/gophergala2016/icebeam_project","https://github.com/gophergala2016/FriendzoneTeam","https://github.com/gophergala2016/zoom_and_enhance","https://github.com/gophergala2016/papyrus","https://github.com/gophergala2016/on_the_go","https://github.com/gophergala2016/blogalert","https://github.com/gophergala2016/floatsy-web-app","https://github.com/gophergala2016/tunein","https://github.com/gophergala2016/0x_Calc","https://github.com/gophergala2016/riichi","https://github.com/gophergala2016/sendto","https://github.com/gophergala2016/bobblehat","https://github.com/gophergala2016/datafolks","https://github.com/gophergala2016/traceapp","https://github.com/gophergala2016/flow","https://github.com/gophergala2016/gobench","https://github.com/gophergala2016/chessVerify","https://github.com/gophergala2016/gophette","https://github.com/gophergala2016/etherapis","https://github.com/gophergala2016/we_for_golang","https://github.com/gophergala2016/gofortune","https://github.com/gophergala2016/alin","https://github.com/gophergala2016/GorgeousGeorge","https://github.com/gophergala2016/drystonedb","https://github.com/gophergala2016/neht","https://github.com/gophergala2016/Gola","https://github.com/gophergala2016/chopher","https://github.com/gophergala2016/go-push","https://github.com/gophergala2016/daemon","https://github.com/gophergala2016/Pomodoro_Crew","https://github.com/gophergala2016/on-the-go","https://github.com/gophergala2016/rex","https://github.com/gophergala2016/sharepass","https://github.com/gophergala2016/talk_to_someone","https://github.com/gophergala2016/Pulse","https://github.com/gophergala2016/goad","https://github.com/gophergala2016/showroom_ci","https://github.com/gophergala2016/nagios-check-runner","https://github.com/gophergala2016/gophertron","https://github.com/gophergala2016/golin","https://github.com/gophergala2016/Pomadoro_Crew","https://github.com/gophergala2016/noshgobble","https://github.com/gophergala2016/zumacoin","https://github.com/gophergala2016/gocompatible","https://github.com/gophergala2016/Politico","https://github.com/gophergala2016/alphagorge","https://github.com/gophergala2016/meshbird","https://github.com/gophergala2016/linq","https://github.com/gophergala2016/kool_monkey","https://github.com/gophergala2016/dagger","https://github.com/gophergala2016/3wordgame","https://github.com/gophergala2016/go_transcript","https://github.com/gophergala2016/gopher_adventure","https://github.com/gophergala2016/rpi-master","https://github.com/gophergala2016/ago","https://github.com/gophergala2016/festivus","https://github.com/gophergala2016/recipe","https://github.com/gophergala2016/stella-artosis","https://github.com/gophergala2016/mandoo","https://github.com/gophergala2016/skeddy","https://github.com/gophergala2016/gobotgo","https://github.com/gophergala2016/spec2test","https://github.com/gophergala2016/dbcom","https://github.com/gophergala2016/tcpovericmp","https://github.com/gophergala2016/gotcptunnel","https://github.com/gophergala2016/slacli","https://github.com/gophergala2016/go_save_log","https://github.com/gophergala2016/go_cover_reporter","https://github.com/gophergala2016/gutenberg","https://github.com/gophergala2016/thunderbird","https://github.com/gophergala2016/stos","https://github.com/gophergala2016/meta_parser","https://github.com/gophergala2016/new_things_project","https://github.com/gophergala2016/phluffy","https://github.com/gophergala2016/servidor","https://github.com/gophergala2016/playground-plus","https://github.com/gophergala2016/goof","https://github.com/gophergala2016/nomnomcoin","https://github.com/gophergala2016/todo","https://github.com/gophergala2016/dbservice","https://github.com/gophergala2016/coolLikeAFoolInASwimmingPool","https://github.com/gophergala2016/gophernotes","https://github.com/gophergala2016/chartit","https://github.com/gophergala2016/pushop","https://github.com/gophergala2016/srtgears","https://github.com/gophergala2016/GrimsonGo","https://github.com/gophergala2016/jable","https://github.com/gophergala2016/GoBlog","https://github.com/gophergala2016/cmd-go-js","https://github.com/gophergala2016/ring_leader","https://github.com/gophergala2016/tbd","https://github.com/gophergala2016/chroniton","https://github.com/gophergala2016/nighthawks","https://github.com/gophergala2016/kjkteam","https://github.com/gophergala2016/scattr","https://github.com/gophergala2016/entropy","https://github.com/gophergala2016/gowars","https://github.com/gophergala2016/skypexp","https://github.com/gophergala2016/go-login","https://github.com/gophergala2016/grozilla","https://github.com/gophergala2016/go_wire","https://github.com/gophergala2016/yagg","https://github.com/gophergala2016/communitychess","https://github.com/gophergala2016/inspector_gopher","https://github.com/gophergala2016/vise","https://github.com/gophergala2016/wdate","https://github.com/gophergala2016/weisshorn","https://github.com/gophergala2016/huk","https://github.com/gophergala2016/Gobots","https://github.com/gophergala2016/runetcd","https://github.com/gophergala2016/magopie","https://github.com/gophergala2016/be","https://github.com/gophergala2016/argon2_go","https://github.com/gophergala2016/kentia","https://github.com/gophergala2016/joat","https://github.com/gophergala2016/go-errbit","https://github.com/gophergala2016/rdbanalyzer","https://github.com/gophergala2016/reviewer","https://github.com/gophergala2016/source","https://github.com/gophergala2016/gopher_typer","https://github.com/gophergala2016/sproc","https://github.com/gophergala2016/lazytest","https://github.com/gophergala2016/spacegophers","https://github.com/gophergala2016/poke","https://github.com/gophergala2016/SubLangLearn","https://github.com/gophergala2016/togepi","https://github.com/gophergala2016/go-emotions","https://github.com/gophergala2016/reqstrict","https://github.com/gophergala2016/enigma","https://github.com/gophergala2016/api_test2","https://github.com/gophergala2016/supbot","https://github.com/gophergala2016/fatbin","https://github.com/gophergala2016/learnlink","https://github.com/gophergala2016/coap","https://github.com/gophergala2016/gogen","https://github.com/gophergala2016/nana","https://github.com/gophergala2016/rara_pirates","https://github.com/gophergala2016/cooling_rack","https://github.com/gophergala2016/gower","https://github.com/gophergala2016/youtube-dl-go","https://github.com/gophergala2016/sing_machine_sing","https://github.com/gophergala2016/keyword-api","https://github.com/gophergala2016/sisho","https://github.com/gophergala2016/tootle","https://github.com/gophergala2016/machine","https://github.com/gophergala2016/gophersiesta","https://github.com/gophergala2016/my_multi_event","https://github.com/gophergala2016/Baggage","https://github.com/gophergala2016/goxy","https://github.com/gophergala2016/telega","https://github.com/gophergala2016/go_goose"]' | |
| urls = JSON.parse(json) | |
| repos = urls.map {|url| url.gsub("https://github.com/", "") }.sort | |
| ACCESS_TOKEN = "..." | |
| client = Octokit::Client.new(access_token: ACCESS_TOKEN) | |
| zero_size = [] | |
| no_description = [] | |
| under_five = [] | |
| under_ten = [] | |
| repos.each do |slug| | |
| puts slug | |
| repo = client.repo slug | |
| if repo.size == 0 | |
| zero_size << slug | |
| elsif repo.description.nil? || repo.description == "" | |
| no_description << slug | |
| else | |
| begin | |
| participation = client.get("/repos/#{slug}/stats/participation") | |
| all = participation.all | |
| number_of_commits = all.inject(0){|a,b| a+b } | |
| if number_of_commits < 5 | |
| under_five << slug | |
| elsif number_of_commits < 5 | |
| under_ten << slug | |
| end | |
| rescue | |
| end | |
| end | |
| sleep 1 | |
| end | |
| puts "\n\nZero size" | |
| puts "=========\n" | |
| puts zero_size.join("\n") | |
| puts "\nNo description set" | |
| puts "==================\n" | |
| puts no_description.join("\n") | |
| puts "\nUnder 5 commits" | |
| puts "===============\n" | |
| puts under_five.join("\n") | |
| puts "\n5-9 commits" | |
| puts "===========\n" | |
| puts under_ten.join("\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment