Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Inyectar Nyancat al Siding (UC)
Este código no es mio.
Autor: Desconocido
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script><br />
<script>//<br />
// Este iframe fallaba<br />
//<iframe src="http://nyan.cat/" width="640" height="480"></iframe><br />
console.log("js injection ");//<br />
var url = "https://raw.github.com/jfix/nyancat/master";//<br />
var keyCode = 16; // shift key<br />
var animationDuration = 9000; // number of milliseconds the animation will take<br />
//<br />
var imgNode = '<img src="'+url+'/nyancat.gif" id="nyancat" width="100" style="position:absolute;z-index:9999;left:-100px;top:250px;" />'//<br />
$("body > table > tbody > tr:nth-child(2) > td.ColorFondoZonaTrabajo").append(imgNode);//<br />
var img = $("img#nyancat");//<br />
//<br />
//<br />
$('body').append('<audio id="sound" preload="auto"><source src="'+url+'/nyancat.ogg" type="audio/ogg"/><source src="'+url+'/nyancat.mp3" type="audio/mp3" /></audio>');//<br />
var sound = $("#sound").get(0);//<br />
//<br />
//<br />
var nyancat_reset = function()//<br />
{//<br />
sound.pause();//<br />
sound.currentTime = 0;//<br />
sound.volume = 1;//<br />
img.css("left", "-100px");//<br />
}//<br />
//<br />
//<br />
function nyancat_start() {//<br />
sound.play();//<br />
img.show().animate({ "left": "+=" + parseInt($("body").width() + 100) + "px"}, animationDuration, nyancat_reset);//<br />
};//<br />
//<br />
//<br />
$("body").keydown(function (event)//<br />
{//<br />
if (event.which == keyCode) {//<br />
nyancat_start();//<br />
}//<br />
}//<br />
);//<br />
//<br />
//<br />
$("#sound").on('timeupdate', function ()//<br />
{//<br />
var vol = 1,//<br />
interval = 200;//<br />
if (Math.floor(sound.currentTime) == 6) {//<br />
if (sound.volume == 1) {//<br />
var intervalID = setInterval(function () {//<br />
if (vol > 0) {//<br />
vol -= 0.10;//<br />
if (vol >= 0.10)//<br />
sound.volume = vol.toFixed(1);//<br />
} else {//<br />
clearInterval(intervalID);//<br />
}//<br />
},//<br />
interval//<br />
);//<br />
}//<br />
}//<br />
}//<br />
);//<br />
nyancat_start();//<br />
</script>
@nacosta-cl
Copy link

nacosta-cl commented May 6, 2015

Hoy lo vi en el SIDING, estaba perfecto en el código.
¿Como lo hicieron?
Me gustaría mucho aprender de estas cosas :D.

@aaossa
Copy link

aaossa commented May 6, 2015

Al parecer hay que ser administrador en algún curso en SIDING para poder inyectar esto

@nacosta-cl
Copy link

nacosta-cl commented May 6, 2015

Ah, ya veo como lo hicieron. Ingenioso

@lopezjurip
Copy link
Author

lopezjurip commented May 6, 2015

Es probable que funcione dentro del foro, habría que probarlo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment