Created
          May 1, 2010 23:05 
        
      - 
      
- 
        Save dirk/386740 to your computer and use it in GitHub Desktop. 
  
    
      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 'rubygems' | |
| require 'highline' | |
| require 'net/http' | |
| h = HighLine.new | |
| count = 0 | |
| while true | |
| body = Net::HTTP.get URI.parse('http://feeds.gawker.com/kotaku/full') | |
| items = body.split(/(halo)|(reach)|(code)/i).length - 1 | |
| if count < items | |
| count = items | |
| puts h.color('New Items', :green, :bold) | |
| system('say "New items."') | |
| end | |
| puts "#{items.to_s} Item(s)" | |
| sleep(2) | |
| end | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment