Skip to content

Instantly share code, notes, and snippets.

@Yengas
Created December 23, 2013 00:04
Show Gist options
  • Save Yengas/8089923 to your computer and use it in GitHub Desktop.
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.
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);
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