The color of your name on Ninja style pools...



  • I figured out how to change my name so I could find myself easier but was wondering if i could be a color besides Salmon.
    Any pool i jump into will be the same color. No big deal really but if there is a wallet setting i do not see feel free to point me in the right direction.

    🙂



  • @darindarin Thanks! always wanted to ask that to but was afraid to!-) (I'm some light ugly red!)



  • I think your name gets hashed and every hash is shifted into a color.



  • Yep, your Burst account gets hashed by the pool software on the server into a smaller number and then that's converted into a color on the server AND frontend.

    Just for fun I wrote a javascript snippet that changes the background color of a specified account to bright yellow:

    function rc(){for(var e=document.getElementsByTagName("a"),r=0;r<e.length;r++){var o=e[r];"YOUR_NAME_HERE"===o.outerText&&(-1!==["current-shares-list","historic-shares-list"].indexOf(o.parentNode.parentNode.parentNode.id)?o.parentNode.parentNode.style.backgroundColor="#ffff00":o.parentNode.style.backgroundColor="#ffff00")}setTimeout(rc,1500)}rc();
    

    Note that it doesn't affect the pie charts, though with more effort that would be possible, too.

    Replace YOUR_NAME_HERE with your account name. While on the ninja pool, hit F12 and then paste this block of code into the Developer Tools console, then hit enter. It will run until you close or refresh the page. It just continually searches for an account name and changes the background of that account to yellow.

    Note that in general when someone tells you to paste code into the Developer Tools console, you shouldn't do it. However this code is safe and even if it wasn't, there's nothing nefarious it could do on the Ninja pool display panel page anyway.



  • @FlippyCakes,

    Very cool. As a person who once used Fortran and Basic a lot, dabbled in C+ and recently struggled to write a small Python program, I am disheartened that in my old age I can't even begin to see what's going on here. Have you been using this language for years? I hope so because if you tell me you just whipped this up I will be so demoralized that I can't understand it.

    Maybe off topic but can you comment on this code to enlighten a noob?

    Thanks.



  • @rds keep changing your name by adding characters, that will then change the hash value, you will eventually find one that shows you in the color you desire.



  • @iKnow0 , Thanks, I was not as interested in the color as how @FlippyCakes was able to write this script. As I get older "it is all Greek to me" 🙂



  • @rds
    10 PRINT "Hello World";
    20 GOTO 10

    You are not that old... lol



  • @iKnow0 ,

    That's the type of code I can understand 🙂



  • @iKnow0 I'm guessing (but don't know for sure without seeing the code) that the shorter account ID used to generate the color is based on the address, not the name attached to it.



  • @FlippyCakes a suggestion, for easy of use you could package as userscript for grease monkey / tamper monkey plugins to auto load (instead of inputting to the console). probably just involve written a header to indicate which web page to use the script on.



  • @rds Yes, I've been using Javascript for years. And I learned programming in the 80's using BASIC and Pascal, so I may be as old or older than you.

    To be fair, I ran the code through an online js code compressor that removed spaces, renamed variables, and rewrote common patterns to be more concise. Here's the original, with annotations:

    function rc() {
      //get all a tags on the page
      var anchor = document.getElementsByTagName('a');
      //loop through each a tag
      for (var i = 0; i < anchor.length; i++) {
        //assign this a to variable a
        var a = anchor[i];
        //if the text in the a tag is YOUR_NAME_HERE do the following:
        if (a.outerText === 'YOUR_NAME_HERE') {
          //okay, so we found the Burst username, but how we set the background color depends on the structure of the ninja page
          //if the a tag's parent element's parent's element's parent element ;) has the id current-shares-list OR historic-shares-list
          if (['current-shares-list', 'historic-shares-list'].indexOf(a.parentNode.parentNode.parentNode.id) !== -1) {
            //this is an a tag sitting in a td tag whose parent tr tag has the applied background color
            //set the a tag's parent element's parent's element (the tr) background-color to #ffff00, or yellow 
            a.parentNode.parentNode.style.backgroundColor = '#ffff00';
          } else {
            //this is an a tag whose parent td tag has the applied background color
            //set the a tag's parent element (the td) background-color to #ffff00, or yellow 
            a.parentNode.style.backgroundColor = '#ffff00';
          }
        }
      };
      //wait 1.5 seconds and call this function again (could probably be more frequent)
      //that way when the page updates and creates new links those, too, will have their color changed.
      setTimeout(rc, 1500);
    };
    //call the function initially to get things started
    rc();
    

    I often use(abuse?) the Chrome Developer Tools to paste code into a website and improve functionality. For example, this color trick is something I run on the Poloniex chat window to highlight names of coins I'm interested in.



  • @damncourier Huh, never thought of that. If I have reason to use this kind of script frequently (as on Poloniex) I may look into that. Thanks!



  • @FlippyCakes yeah look into it. plugins are grease monkey for firefox, tamper monkey from chrome. sounds like it could make your life much easier 😉



  • @FlippyCakes thanks i did not know that.