TeamNZ Bot Update v1.0.3 - Tales of Bugs and Spammers

in #steemit7 years ago (edited)

After some bloody battles the Kiwibot returns, now stronger than ever and with exciting new features.

teamnz-bot-sheep.png
Photo credits: @lordnigel

Hello guys I want to give you an update on the situation around our lovely community bot. A few of you may know that this weekend has kind of been a rollercoaster ride for me: Our bot has been a victim of relentless spam and tag abuse and I had to take it offline for a few days top implement some changes and prevent further draining of Voting Power on the worst kind of trash.

Long story short, I'm very happy to tell you that the changes have been made and the Kiwibot is now back online!

First spam attack

If you do want to hear the story: On friday night I noticed some unusual voting activity in the server logs and decided to investigate. Welp, it turns out that it took spammers less than 72 hours of runtime to figure out that they could take advantage le sigh

Screenshot from 2018-03-06 07-41-06.png

To take immediate action I unvoted the rubbish and implemented a sloppy blacklist and went to sleep after running a quick test.

More abuse

Next morning the spam army was back....in numbers. I had blocked 4 people but now there were 10 more and now posting blatant spam just to abuse the bot:

I have no words for this.

But I do have a picture

I realized that the quick fix did not work: for every spammer I block, 3 more will appear. By now the VP was significantly drained by these assholes so I took the bot offline to make the updates and give it time to heal VP.

Whitelist

So unfortunately the update took me a bit longer than expected because I had a crazy busy weekend :O I decided to make a whitelist and allow only verified Teamnz members to use the bot. This means that spammers would be ignored completely (except for messing up our tag I guess).

It took me a while to gather all the names for the list, and I am just a human so I may have forgotten someone or misspelled a username...if you can't summon the bot and you should be able to, please come talk to me in Discord.

For the more techy amongst you: If you are interested on how the whitelist is written I found a very elegant way to do this(js) :


if(blacklist.indexOf(author) > -1){
console.log(author, ': This User is blacklisted.');
                        postWarning(ACCOUNT_NAME,ACCOUNT_KEY,author,link);
                                                    }
else if(whitelist.indexOf(author) > -1){
                        console.log('Tag found in: ',link, ' by: ', author);
                        postComment(ACCOUNT_NAME,ACCOUNT_KEY,author,link);
                        sendVote(ACCOUNT_KEY, ACCOUNT_NAME, author, link, 10000);
                          }

Where indexOf checks the author property of the blog post against an array of whitelisted and blacklisted names.

Yeah, take that spammers!

Bugs & Patches

So far the bot had a hard time dealing with 'post updates' since they are broadcasted on the STEEM blockchain with the tamnz tag, the bot would pick the post up again and comment after every post edit. It looks a bit funny when he comments 4 times on the same blog. (Get it right the first time people! JK)

So I believe I have fixed this now.

If you are interested in how this works: getContentReplies call allows me to pull the comments on a post:

Then I loop through the array and set a variable if already commented, to skip this post.

        steem.api.getContentReplies(author, link, function(err, result) {
        console.log(err, result);
        console.log('Array length: ', result.length);
        check = 1;
        if(result.length>0){
          for(i=0;i<result.length;i++){
            if(result[i].author==ACCOUNT_NAME){
               check = 0;
                }
              }
            }
        });

New features

The most attentive of you may have noticed that the bot did vote on a few posts even during the weekend downtime? What?

This is becase it was voting from steemauto on the posts written by it's delegators. I implemented this because I think that the delegators deserve to get something back for their community support, regardless or the which tags they use. Consider it a "premium" feature that delegatoers get 100% uptime even during patches :P

At this point a big thank you to @ausbitbank, @devi1714 and @jackmiller for delegating to the bot. Also a big thanks to @ravenruis and @devi1714 for following the curation trail. You guys are awesome!

You can help support TeamNZ!

You can delegate some SP and give the Kiwi community some love.

The easiest way to do this is to construct a URL with Steemconnect and then paste it into your browser! This is the correct format:

https://steemconnect.com/sign/delegateVestingShares?delegator=YOURUSERNAME&delegatee=BOTUSERNAME&vesting_shares=AMOUNT%20SP

Change the USENAMES and SP Values! Here is an example of how I would do this:

https://steemconnect.com/sign/delegateVestingShares?delegator=cryptonik&delegatee=teamnz&vesting_shares=20%20SP

You can also follow the curation trail instead of delegating

Following a curation trail means that you will follow the bot and copy his votes. Every time he votes, you will vote too.

We have setup a curation trail on Steemauto. On steemauto you can also set the percentage of your vote weight, and set the limit on how far your voting power can be depleted.

Make an account on https://steemauto.com and follow @teamnz!

Here is the direct link: https://steemauto.com/dash.php?i=1&trail=teamnz

I hope we can get some more support and spread some love among the Kiwis on Steemit :)

Join Us on Discord

If you haven't already, please come and join us on the South Pacific (AUS/NZ) Community server

Click to join server

We are excited to meet you and learn more about you!

Sort:  

Oh great and wonderful upvote bot, how I have missed seeing your weirdly adorable face around the place this weekend.
It is so good to have you back!

And just as a reminder, our bot needs a name! Competition post can be found here. Get your entries in, or the bot may end up being called honey-boo-boo or something....

Haha yes! Cmon guys enter the competition!

Honey boo boo isn't that bad! On the other hand I am teamaustralia.

Just for you ... you're welcome :D

roo.jpg

Good job, I wish I could program. Looks like fun! Aside from the bug stuff...

Never to late to start ;)

I got as far as getting python and doing some tutorials. I remember at university I really wasn't that good at it. Maybe I should try again, any good recommendations for a beginner? Please don't say build a Tetris clone...

Wow, I just watched that twice completely. It's mesmerising!

haha thought you'd enjoy it :D


This is a curation bot for TeamNZ. Please join our AUS/NZ community on Discord.
For any inquiries/issues about the bot please contact @cryptonik.

I wondered what had happened, thanks for the update.

Man bot work is hard work... then to have people messing with it.

Congrats on IBT#3 by the way :)

...hey you also needed to say thanks to lordnigel for his photo of the south American lemur haha..actually reminds me of yeti

Won the IBT again, no way haha and I added the credits!!! :D

Thanks for this I wasnt aware abut it! I am a New Zealand who has recently moved to Spain so will be nice to be in contact with some Kiwis here.

I joined the discord chat group :)

Thank you, cryptoninc !!! It is great that you managed to fix this as this is a really useful bot (for people like me)!!!

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 62978.31
ETH 2546.24
USDT 1.00
SBD 2.76