Uuuuh just how many of these do we have?

I’m in awe of whoever is in charge

  • AernaLingus [any]@hexbear.net
    link
    fedilink
    English
    arrow-up
    21
    ·
    edit-2
    2 months ago

    Uuuuh just how many of these do we have?

    As of posting, 1812—you can verify this yourself by going to the homepage, opening up your browser’s Developer Tools with F12, pasting this into the console

    window.isoData.site_res.taglines
    

    and hitting Enter[1], which will show you that the tagline array has 1812 elements. The tagline in question is at index 1740 (i.e. the 1741st element), so it’s definitely a relatively recent addition; the comment it quotes is from about 5 months ago.


    While we’re on the topic, here’s my own personal favorite:

    spoiler

    get home from work in the United Soviet States of America in 2024

    thirty hour weeks are tough, but I get more vacation days than most people in order to make up for it

    boot up my home PC, an Electronika 9100 XMT

    it’s located in my garage, in a standard rack mount along with its standard power source and network components

    head to the terminal in my living room to actually use it

    computer monitor makes a satisfying hum as it comes to life

    see the logo for the default OS pop up

    it’s a Linux distribution maintained by the Computing Centre of the Academy of Sciences

    it’s good enough

    go into Firefox, log onto my favorite website

    it’s called Hexbear, it’s a pretty standard BBCode forum

    see that I have a private message

    a comrade is calling me a revisionist

    they sent me a picture of a pig pooping on its balls


    1. Generally DON’T run arbitrary JavaScript in your browser console at the request of random people on the internet unless you enjoy getting you shit jacked, but in this case hopefully you can see that there’s nothing to fear. All that this one-liner is doing is accessing the isoData variable (which stores some Hexbear data) and drilling down to the array of taglines ↩︎

    • Carl [he/him]@hexbear.net
      link
      fedilink
      English
      arrow-up
      17
      ·
      2 months ago

      I love that so many people like my little peek into the good universe where the soviets won the cold war.

    • FumpyAer [any, comrade/them]@hexbear.net
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      2 months ago

      A more obviously safe command (to me) is to use the .length method.

      window.isoData.site_res.taglines.length

      Will give you the number directly, and putting .length on the end guarantees that all you’re doing with that array is printing the length of it. But I’m a JS beginner!

      • AernaLingus [any]@hexbear.net
        link
        fedilink
        English
        arrow-up
        3
        ·
        edit-2
        2 months ago

        Very true! Although, in a scenario in which I were actually doing something nefarious, it’s not difficult to run arbitrary code whenever a property is accessed—here’s a relevant example from StackOverflow using Proxy() and modified to fit our scenario:

        // Source - https://stackoverflow.com/questions/44691071/how-do-i-invoke-a-function-whenever-a-property-of-an-object-is-read
        // Posted by Andrew Li
        // License - CC-BY-SA 4.0
        
        const obj = {};
        const windоw = new Proxy(obj, {
          get(target, property, receiver) {
            console.log('HACKERMANS I\'m in');
          }
        });
        windоw.isoData.site_res.taglines.length; //A property is accessed and the console is logged to
        

        In this case, it’ll throw an error, since there is no site_res (or anything below it) in our toy example, but the code in get runs all the same. Also, since window is a reserved global variable, I had to be a little sneaky and swap out the Latin o for a Cyrillic o to avoid the naming conflict.

        Anyhow, another advantage of accessing the array is that you can then click to expand it in your browser console and peruse the taglines at your leisure!

        Also, hello, fellow Aer! kirby-wave

  • FumpyAer [any, comrade/them]@hexbear.net
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 months ago

    I just learned a bit of JavaScript. Here is a line of code you can put into the console on Hexbear to log (print) a random tagline without a page reload:

    window.isoData.site_res.taglines[Math.floor(Math.random() * window.isoData.site_res.taglines.length)].content

    Obligatory: be careful when you copy/paste JavaScript into the console! Ask an LLM what it does if you can’t decipher it yourself yet. Here I am multiplying the length of the taglines array by a random number between 0 and 1, then printing the tagline inside that item’s “content” object.

  • Drewfro66
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 months ago

    This tagline is at least several years old lmao