Created
April 1, 2013 13:05
-
-
Save lyuehh/5284831 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 'open-uri' | |
require 'nokogiri' | |
def check | |
doc = Nokogiri::HTML(open('http://www.yyets.com/resource/10733')) | |
doc.css('.f14').each do |l| | |
if l.to_s.include?('片源') | |
puts 'no' | |
sleep 60 * 10 | |
else | |
`terminal-notifier -message "可以看了..."` | |
puts "haha" | |
exit | |
end | |
end | |
end | |
while true | |
check | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
桌面通知只支持mac系统, 使用
gem install terminal-notifier
安装