In this post I'll explain for beginners, how to create a custom algorithm for the open source Steem voting bot "FOSSbot"
FOSSbot a free and open source, highly customizable Steem voting bot created by @personz.
To install your own FOSSbot see these instructions
Or go straight to the FOSSbot Github page
https://github.com/Steem-FOSSbot/steem-fossbot-voter/blob/master/docs/installation.md
The bot works by scanning a set number of posts every time the bot runs.
The bot will use the arguments/metrics in your algorithm to assign each post a score and will then vote for the posts with a score that is above the average threshold.
Here is a basic example of an algorithm that tries to find and vote for "good" content.
post_num_words in range 200 to 600, weight = 0.5
post_num_links_image in range 0 to 5, weight = 10
post_num_links_video, weight = -25
author_repuation, weight = 1
post_has_english_language_use, weight = 50
Here is what each argument does:
post_num_words in range 200 to 600, weight = 0.5
If the post has between 200 and 600 words
Then the bot will add 0.5 score points to the post for every word that is more than 200.
If the post has less Than 200 words
Then no score points will be added
If the post has more than 600 words
Then no extra score points will be added after the 600 word limit
post_num_links_image in range 0 to 5, weight = 10
If the post contains between 0 and 5 images
Then 10 score points will be added to the post for every image
If the post has more than 5 images
Then score points will only be added for the first 5 images
post_num_links_video, weight = -25
If the post contains links to videos
Then 25 score points will be subtracted for every video
author_repuation, weight = 1
If the author of the post has 55 reputation points for example
Then 55 points are added to the score of the post
post_has_english_language_use, weight = 50
If the post contains English
Then 50 points are added to the score
The bot will consider a post to be good if:
- the post is at least 200 words long
- the post has a few images
- the post has few or no video links
- the author of the post has some reputation
- the post is in English
Fossbot provides lots of other metrics and settings that can be added to make your bot better. These are only the basics, but if you understood how this example works, you will be able to understand the rest.
I will be posting more algorithm examples soon. Join the FOSSbot project on Github and add your ideas. https://github.com/Steem-FOSSbot/steem-fossbot-voter
Suggestions are welcome and feel free to ask questions in the comments.
Good luck out there!