Created
April 26, 2017 21:48
-
-
Save atog/0363badb92d43da8a29f4b831215d0e3 to your computer and use it in GitHub Desktop.
This file contains 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
# install the 't' gem: httjp://sferik.github.io/t/ | |
# set the path to the executable | |
t_cmd = '~/.rbenv/shims/t' | |
followings = `#{t_cmd} followings`.split /\s/ | |
whois_cmd = "#{t_cmd} whois " | |
activity = {} | |
followings.each do |f| | |
info = `#{whois_cmd} #{f}` | |
last_active = {f => info.match(/Last update.*\((.*)\)/).captures.first} | |
activity.merge! last_active | |
end | |
years = activity.select {|k,v| v =~ /years/} | |
months = activity.select {|k,v| v =~ /months/} | |
months = months.select {|k,v| v[0,2].to_i > 3} | |
all_inactive = years.merge(months) | |
# run t unfollow {output from the command below} | |
puts all_inactive.keys.join(' ') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment