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



  • @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.


Log in to reply
 

Looks like your connection to Burst - Efficient HDD Mining was lost, please wait while we try to reconnect.