Skip to content

Instantly share code, notes, and snippets.

@atog
Created April 26, 2017 21:48
Show Gist options
  • Save atog/0363badb92d43da8a29f4b831215d0e3 to your computer and use it in GitHub Desktop.
Save atog/0363badb92d43da8a29f4b831215d0e3 to your computer and use it in GitHub Desktop.
# 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