Created
December 28, 2018 22:12
-
-
Save rokumatsumoto/e7cd7d8f3948995af6b4106fccbb7ab8 to your computer and use it in GitHub Desktop.
hac kura sayfasindaki degisiklikleri takip eder, sesli bildirir. sadece mac os sistemlerde calisir.
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 'nokogiri' | |
require 'open-uri' | |
doc = Nokogiri::HTML(open('http://hac.gov.tr/', open_timeout: 100)) | |
File.open("hac.html", "wb") do |f| | |
f.write(doc.to_html) | |
end | |
doc1 = File.open("hac.html") { |f| Nokogiri::HTML(f) } | |
loop do | |
puts 'checking ten seconds inverval' | |
sleep 10 | |
doc2 = Nokogiri::HTML(open('http://hac.gov.tr/', open_timeout: 100)) | |
unless doc1.to_html === doc2.to_html | |
# $ youtube-dl -i --extract-audio --audio-format mp3 -o "%(title)s-%(id)s.%(ext)s" https://www.youtube.com/watch\?v\=IB0o6uTGu9c | |
fork { exec 'afplay', "Abdurrahman-Onul-Kabenin-Yollari.mp3" } | |
# $ killall afplay | |
break | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment