Advertisement
Alexquickdraw

[Chatango] Show visitors username in full profile

Oct 4th, 2018
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // A simple script that allows the full profile to load even if flash is disabled.
  2. //-> Edit the "html" variable with your HTML, CSS and full profile text.
  3. //-> The "name" variable contains the full profile visitors username. (example) => 'Hello '+name+', welcome to my profile!'
  4. //-> Edit the "YoutubeSongID" variable with a youtube video ID to play background music in the full profile, or leave it blank.
  5. //-> Upload the code to https://pastebin.com/ and click "raw" after you uploaded it.
  6. // Paste <script src = "URL OF PASTE"></script> inside your mini.
  7. // By @Hardware
  8.  
  9. //Initializes when the page is fully loaded
  10. window.onload = init;
  11.  
  12. //Generates Anon number
  13.  function AnonNum(min, max) {
  14.     return Math.floor(Math.random() * (max - min) ) + min;
  15. }
  16.  
  17. //Main
  18. function init(){
  19.  
  20.  //Gets document cookie
  21.  var cookie = document.cookie;
  22.  
  23.  //Regex that gets the visitors username from the cookie
  24.  try {
  25.   var name = cookie.match("id.chatango.com=(.*?);")[1].charAt(0).toUpperCase() + cookie.match("id.chatango.com=(.*?);")[1].substr(1);  
  26. }
  27.  
  28. //Generates Anon name if the visitor isn't logged in
  29.  catch(err) {
  30.   var name = "Anon"+AnonNum(1000,9999).toString();
  31. }
  32.  
  33.  //Youtube song ID
  34.  var YoutubeSongID = "TFpZDoMSFl0";
  35.  
  36.  //Youtube player (Don't need to touch this) => loads at the end of html var
  37.  var backgroundMusic = '<iframe width="0" height="0" frameborder="0" allow="autoplay" '+
  38.                        'src="https://www.youtube.com/embed/'+YoutubeSongID+'?autoplay=1&mute=0"></iframe>';
  39.  
  40.  //HTML, CSS and profile text section
  41.  var html = '<html><style>html {background-image: url("https://i.imgur.com/fAG6kaG.gif"); repeat fixed center;}'+
  42.             '</style><style> html, body {height: 100%; width: 100% position: fixed; overflow: hidden;} '+
  43.             'img {position: fixed; bottom: 0; left: 0; height: 100% width: 100%;}'+
  44.             '</style><title>Hey there nerds</title><body>'+
  45.             '<p align ="center"><font color = "#FFFFFF" size = "9" face="Palatino Linotype"><style>body{font-size: 9; padding: 0}'+
  46.             '@keyframes blink {0% {opacity: 0} 49%{opacity: 0} 50% {opacity: 1}}blink{animation: blink 1s infinite;}'+
  47.             '</style>&gt;&gt; Hello '+name+', sup?<blink>_</blink></p><br>'+
  48.             '</font><br><br><img src ="https://i.imgur.com/gvrK2cV.png"></img></body>'+
  49.             '</html>'+backgroundMusic;
  50.  
  51. //Writes the data to the page
  52.  document.getElementById(null);
  53.  document.write(html);
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement