HSBI Bookmarklets Updated — Quick Tipping Made Easy

avatar

A few weeks ago (or longer) @thecrazygm moved a lot of his Hive scripts to a new server. This is cool and was an overall improvement. The new location.

Unfortunately this change broke the bookmarklets I made before for tipping people in HSBI. It’s an easy enough fix to update them: I just have been really busy lately and hadn’t taken the time to do so. Well — now I have!

Just to reintroduce them:

  • I have one that when pressed will prompt you to enter a name and an amount, then it will send that amount of HSBI to that person.
  • I have another that when pressed will automatically grab the username of the author of the post you currently have open in peakd and will prompt you for an amount and then send that amount to the post author.

I call them “→send HSBI” and “→send HSBI (auto name)”. Yeah, boring names. Feel free to be more creative that me.

Make a Bookmarklet

Making a bookmarklet is easy enough.

  1. Bookmark any random page.
  2. Edit that bookmark
  3. Erase the URL and replace it with the bookmarklet code. Also replace the name with a better one.
  4. Optional: Move the bookmarklet to the menu bar so that you can easily click on it.

Bookmarklet no. 1 - Send HSBI

Copy this code:

javascript:(function(){var name=prompt("Enter the Hive username:"),amount=prompt("Enter the amount:");if(name&&amount){window.open("https://tools.crypto-dreamr.com/tipjar/steembasicincome/"+encodeURIComponent(amount)+"/hive/"+encodeURIComponent(name),"_blank");}})();

and paste it into the URL of your bookmarklet. It’ll look something like this:

Bookmarklet no. 2 - Send HSBI (auto name)

Copy this code:

javascript:(function(){var url=window.location.href,match=url.match(/@([^\/]+)/),name=match?match[1]:"";if(!name||name.toLowerCase()==="dbooster"){name=prompt("Enter the Hive username:");}if(name){var amount=prompt("Enter the amount:");if(amount){var newTab=window.open("");newTab.location.href="https://tools.crypto-dreamr.com/tipjar/steembasicincome/"+encodeURIComponent(amount)+"/hive/"+encodeURIComponent(name);}}})();

and paste it into the URL of your bookmarklet. It’ll look something like this:

That’s it! Now go and spread forth HSBI unto all who doth deserve thy kindness.

By the way, if you want to see what’s going on or if you think you can improve on these. Here is the first in a non-minified format and with comments:

javascript:(function () {
    // Prompt the user for a Hive username
    var name = prompt("Enter the Hive username:");

    // Prompt the user for the amount
    var amount = prompt("Enter the amount:");

    // If both a name and an amount were entered
    if (name && amount) {
        // Construct the URL using encodeURIComponent for safety
        var url = "https://tools.crypto-dreamr.com/tipjar/steembasicincome/"
            + encodeURIComponent(amount)
            + "/hive/"
            + encodeURIComponent(name);

        // Open the constructed URL in a new browser tab
        window.open(url, "_blank");
    }
})();

and here is the second:

javascript:(function () {
    // Get the current page URL
    var url = window.location.href;

    // Try to extract a Hive username from the URL (pattern: @username)
    var match = url.match(/@([^\/]+)/);

    // If a match is found, take the username; otherwise, leave it blank
    var name = match ? match[1] : "";

    // If no username was found OR it matches your own username ("dbooster"),
    // then prompt the user for a Hive username instead
    if (!name || name.toLowerCase() === "dbooster") {
        name = prompt("Enter the Hive username:");
    }

    // If we have a username (either detected or entered manually)
    if (name) {
        // Prompt for the amount
        var amount = prompt("Enter the amount:");

        // If an amount was entered
        if (amount) {
            // Open a new blank tab
            var newTab = window.open("");

            // Build the URL and set it as the new tab’s location
            newTab.location.href =
                "https://tools.crypto-dreamr.com/tipjar/steembasicincome/"
                + encodeURIComponent(amount)
                + "/hive/"
                + encodeURIComponent(name);
        }
    }
})();

Enjoy using them! And if you add any improvements, please share back so I can see them!

Hi there! David is an American teacher and translator lost in Japan, trying to capture the beauty of this country one photo at a time and searching for the perfect haiku. He blogs here and at laspina.org. Write him on Bluesky.

【Support @dbooster with Hive SBI】



0
0
0.000
3 comments
avatar

Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

Consider setting @stemsocial as a beneficiary of this post's rewards if you would like to support the community and contribute to its mission of promoting science and education on Hive. 
 

0
0
0.000
avatar

I've never circled back to this to see if I could get any of mine to work. I kind of gave up for a bit after I ran into all those issues before. This seems like a cool use for them though.

0
0
0.000
avatar

I think I tried this some time back but had some trouble and never tried again. I'll have to take another look now!

0
0
0.000