Advertisement
floxster

getuserchatango

Nov 26th, 2015
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. function getCookie(cname) {
  2. var name = cname + "=";
  3. var ca = document.cookie.split(';');
  4. for(var i=0; i<ca.length; i++) {
  5. var c = ca[i];
  6. while (c.charAt(0)==' ') c = c.substring(1);
  7. if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
  8. }
  9. return "anonymous";
  10. }
  11.  
  12. function __init__() {
  13. var viewer = getCookie('id.chatango.com');
  14. val = 0;
  15. res = ["halo {user} :)", "selamat datang {user} :D", "dasar {user} tukang ngintip :P"];
  16. intro = res[Math.floor((Math.random() * res.length))].replace("{user}", viewer);
  17. vid = document.createElement("audio");
  18. vid.src = songs[val][0];
  19. vid.autoplay = true;
  20. vid.onended = function() {
  21. val = val + 1;
  22. if (val >= songs.length) {
  23. val = 0;
  24. }
  25. vid.src = songs[val][0];
  26. title(intro , songs[val][1]);
  27. }
  28. title(intro , songs[val][1]);
  29. }
  30. __init__()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement