Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. # install the 't' gem: httjp://sferik.github.io/t/
  2. # set the path to the executable
  3.  
  4. t_cmd = '~/.rbenv/shims/t'
  5.  
  6. followings = `#{t_cmd} followings`.split /\s/
  7. whois_cmd = "#{t_cmd} whois "
  8.  
  9. activity = {}
  10.  
  11. followings.each do |f|
  12. info = `#{whois_cmd} #{f}`
  13. last_active = {f => info.match(/Last update.*\((.*)\)/).captures.first}
  14. activity.merge! last_active
  15. end
  16.  
  17. years = activity.select {|k,v| v =~ /years/}
  18. months = activity.select {|k,v| v =~ /months/}
  19. months = months.select {|k,v| v[0,2].to_i > 3}
  20. all_inactive = years.merge(months)
  21.  
  22. # run t unfollow {output from the command below}
  23. puts all_inactive.keys.join(' ')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement