Created
December 23, 2013 00:04
-
-
Save Yengas/8089923 to your computer and use it in GitHub Desktop.
Youtube şarkısı bittikten sonra, bilgisayarı kapatır çünkü bilgisayarı şarkı bittikten sonra kapanıcak şekilde zamanlamak is oldschool.
This file contains 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
var scrubber = document.getElementsByClassName("html5-scrubber-button")[0]; | |
var interval = setInterval(function(){ | |
if(window.parseInt(scrubber.style.webkitTransformOriginX.replace("%","")) == 100){ | |
var ws = new WebSocket("ws://192.168.1.10:6321"); | |
ws.onopen = function(){ ws.send("shut"); }; | |
} | |
}, 5000); |
This file contains 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 'em-websocket'; | |
EM.run { | |
EM::WebSocket.run(:host => "192.168.1.10", :port => 6321, :debug => false) do |ws| | |
ws.onmessage { |msg| | |
if msg == "shut" then %x( shutdown -s -f -t 0 ); end | |
} | |
end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment