Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 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(' ')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement