💰 Over 9000

Man, oh man. I'm kicking myself writing this now (well, maybe not now, but Bitcoin did hit like $69k at one point). The background: Bitcoin was having a rally moment. I wrote a little script to post "It's over 9000!" to Slack when the price went over 9000 (Gotta love DBZ).

For those who are unfamiliar with the phrase, the "over 9000" line originated from an episode of the Japanese Anime series Dragon Ball Z. In an episode in which Vegeta, one of the main characters, is shocked to learn that Goku's (the main character) power level is over 9000. In the original Japanese version, Vegeta simply says "it can't be!" but in the English dub, he says "over 9000" with a mix of disbelief and anger.

The line quickly gained popularity among fans, who began using it as a meme to express amazement or incredulity at something. It has been referenced in a variety of media, including other anime and manga series, video games, and even mainstream television shows.

"Over 9000" remains a beloved catchphrase among Dragon Ball Z fans. It has become a symbol of the series' larger-than-life spirit, and it continues to be referenced and celebrated in pop culture. If only I had capitalized on the price fluctuations of Bitcoin at the time, I may have faired better than our dear friend Yamcha.

Vegeta Over 9000

Anyways, I actually forget the exact method that this script was implemented, but it should have dumped the "Over 9000" gif into a Slack channel once Bitcoin hit that price point.


<html lang="">

<head>
  <meta charset="utf-8">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <title>Over9000</title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
</head>

<body>
  <!--[if lte IE 9]>
    <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience and security.</p>
  <![endif]-->

  <div id="output"></div>

  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  <!-- Your custom script here -->
  <script type="text/javascript">
    function getUrlParameter(name) {
      name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
      var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
      var results = regex.exec(location.search);
      return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
    };

    let gifURL = '';

    axios.get('https://api.coindesk.com/v1/bpi/currentprice.json')
      .then(function (response) {
        // handle success
        console.log(response);

        if(response.data.bpi.USD.rate_float > 9000) {
          gifURL = 'https://i.giphy.com/tPKoWQJk3cEbC.gif';
        } else {
          gifURL = 'https://media.giphy.com/media/fnm3kPuXazD7sTZTqW/giphy.gif';
        }

        const payload = JSON.stringify({"text": gifURL});
        const token = getUrlParameter('token');
        const url = 'https://hooks.slack.com/services/' + token;
        axios.post(url, payload);

        document.getElementById('output').innerHTML = '<img src="' + gifURL +'" alt="Bitcoin price">';

      })
      .catch(function (error) {
        // handle error
        console.log(error);
      });

  </script>

</body>

</html>