AutoBadger: Follow accounts based on token metrics

Hey everyone,

Today I'm sharing a new tool I've been working on called Badger. It's an auto-follow manager designed specifically for "badge" accounts or curation projects on Hive. The script automatically follows (and optionally unfollows) accounts based on their token holdings or Hive Power delegations, helping you keep your follow list in sync with your community's stakeholders.

The idea was expanded after a request from @hivepakistan to add a feature to follow accounts based on their HP delegations, which is now included.


What Can Badger Do?

Badger is highly configurable. You can set it to manage your follows based on several metrics:

  • stake: Follows users based on their staked amount of a specific token.
  • balance: Follows based on the liquid balance of a token.
  • total: Follows based on the combined total of staked and liquid tokens.
  • delegation: Follows accounts based on their incoming HP delegations to your account.

You can set a minimum threshold for any of these metrics, and the script will handle the rest.


How to Use Badger

The script is designed to be run easily and safely. Here’s a quick walkthrough.

1. Create a Configuration File

First, you'll want to create a default badger.yaml configuration file. You can do this by running the script with the --create-config flag.

uv run https://gist.github.com/TheCrazyGM/f24014d61d4b1284687b2c11f4a333e3 --create-config

badger-create.png

This will generate a badger.yaml file in your current directory.

badger_config.png

2. Edit Your Settings

Next, open badger.yaml and edit the settings to match your needs. You'll need to set your account name, the token you want to track, the metric, and the minimum threshold. You also need to provide your posting key, either in the file or as an environment variable (POSTING_WIF).

3. Run a Dry Run

Before making any changes, it's always best to perform a dry run. You can override any setting from your config file using command-line flags.

For example, to see who you would follow from the PIMP token holders with a total of at least 100,000 tokens:

./badger.py --dry-run --account thecrazygm.bank --token pimp --metric total --min-token 100000

badger-pimp.png

Or, to see who you would follow based on a minimum of 500 HP delegated to the hivepakistan account:

./badger.py --dry-run --account hivepakistan --metric delegation --min-tokens 500

badger-hivepakistan.png

Once you are happy with the dry run, you can run the command without the --dry-run flag to have Badger actually perform the follows and unfollows. You can see all available options by running the script with the -h flag.

Get the Script

You can find the script and run it directly from the Gist below.

As always,
Michael Garcia a.k.a. TheCrazyGM

0.16815060 BEE
7 comments

!BBH

0.00019136 BEE

Curious about HivePakistan? Join us on Discord!

Delegate your HP to the Hivepakistan account and earn 90% of curation rewards in liquid hive!


Follow our Curation Trail and don't miss voting!


Additional Perks: Delegate To @ pakx For Earning $PAKX Investment Token


Curated by dlmmqb

0.00019094 BEE

This is a super useful tool for community leaders! I'll have to keep in mind for our own future use! Excellent! 😁 πŸ™ πŸ’š ✨ πŸ€™

0.00019027 BEE

Great work releasing this incredibly useful gist! It will be a great and useful part of the project builder pack!

!PAKX
!PIMP
!PIZZA

0.00018830 BEE

View or trade PAKX tokens.

@ecoinstant, PAKX has voted the post by @thecrazygm. (1/2 calls)



Use !PAKX command if you hold enough balance to call for a @pakx vote on worthy posts! More details available on PAKX Blog.

0.00019416 BEE

Congratulations @thecrazygm! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You received more than 35000 upvotes.
Your next target is to reach 40000 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

0.00018754 BEE

PIZZA!

$PIZZA slices delivered:
@ecoinstant(1/20) tipped @thecrazygm

Come get MOONed!

0.00018445 BEE
(edited)

Thanks for open sourcing. I had this script but it wasn't open sourced. Also I liked the notes u added. It's easier to understand code now.

Thanks a ton! 😊

I can start working on fixing my other code's logic as badge should be working in order for some other pieces of puzzle to be improved too.

-0.19522620 BEE