Playing With A Reward Abuse Detection Bot!

in #funny7 years ago (edited)




This isn't a tutorial, more having fun with a little side project I set as a challenge to myself, nonetheless - I've provided my code at the bottom of the page (it's a little messy).

I'd have loved to have submitted this in the #comedyopenmic comp but I'm nearing the point of spam so I'll just go wild with the upvote bots instead :)





Chapter 1: The Dirty Lawyer

A quick glance at the data we've just collected shows lots of last minute votes going to @journeyoflife, all of those votes seem to be for about a dollar... Let's have a look at one of these posts...



She's not exactly destroying the reward pool but I don't believe that comment is worth $1.66 when minnows might spend hours on a post and get nothing.

The real problem here is that her brother is creating too many miners and has no clue where to put them all!


Ahh, it all makes sense now... You'll make an excellent lawyer one day, I'm sure of it!



Chapter 2: Mr RobotNet

If you don't see foul play here, you must be off in a world of your own. ~1156 votes on all four posts.

I wonder who owns this botnet? How much money are they making? Why did you do this to us @chaknorris? You were my hero as a kid!





Chapter 3: The Next Shakespeare

I really don't know why I've included this master wordsmith to be quite frank with you, his literary skills are truly unparalleled on the steemit platform, every comment he makes is worth at least $0.30 and that's a highly conservative valuation.


Steemit is full to the brim with spam, making it very difficult to find original content and raw talent, much like that which is produced by @jamsapa


Below, you can see him writing a detailed synopses on some fine art he has been reviewing.



That's all for today folks! Let me know if this is considered 'stalking' or whatever...



from steem import Steem
from steem.blockchain import Blockchain
from steem.steemd import Steemd
from steem.instance import set_shared_steemd_instance
from coinmarketcap import Market
from datetime import datetime

nodes = ['https://api.steemit.com',
           'gtg.steem.house:8090',
           'steemd.steemitdev.com',
           'steemd.steemitstage.com',
           'steemd.steemgigs.org']

coinmarketcap = Market()
s = Steem(nodes)
bchn = Blockchain()

set_shared_steemd_instance(Steemd(nodes=nodes))
currentBlock = s.get_dynamic_global_properties()['head_block_number']

def infoDigger(opType):
    abuse = False
    author = opType['author']
    permlink = opType['permlink']
    cashout = s.get_content(author, permlink)['cashout_time']
    cashout = datetime.strptime(cashout, '%Y-%m-%dT%H:%M:%S')
    now = datetime.now()
    diff = cashout - now
    if diff.days < 1 and diff.days>=0:
        hours = diff.seconds/3600
        print('last day')
        print("https://steemit.com/@" + author + "/" + permlink)
        print(hours)
        if hours < 24:
            voter = opType['voter']
            weight = opType['weight']*0.0001
            try: voterAccount= s.get_account(voter)
            except: print(voter)
            vests = float(voterAccount['vesting_shares'].replace(" VESTS",""))
            vests -= float(voterAccount['delegated_vesting_shares'].replace(" VESTS",""))
            vests += float(voterAccount['received_vesting_shares'].replace(" VESTS",""))
            vests *= 1000000
            vests *= 0.02
            vests *= weight
            
            rewardFund = s.get_reward_fund('post')
            fundVests = float(rewardFund['recent_claims'])
            fundBalance = float(rewardFund['reward_balance'].replace(" STEEM",""))
            fundPercent = vests/fundVests
            fundReward = fundPercent*fundBalance
            
            steemMC = float(coinmarketcap.ticker('STEEM', convert='USD')[0]['price_usd'])
            usdReward = steemMC * fundReward
            
            print("$" + str(usdReward))
            print(voter)
            if usdReward > 5:
                abuse = True
                print(abuse)
    
for i in bchn.stream(filter_by=['vote']):
    infoDigger(i)
    currentBlock += 1

This is the output and it might look confusing but here's the breakdown:

  • 'last day' means a vote has gone to a post cashing out within a day
  • then the full url of the post is below that
  • then the number of hours until cashout
  • the value of the vote
  • the voter



Sort:  

Great post! You just got a 41.96% upvote from @edensgarden!
Thanks for tasting the eden!

Congratulations, your post received 2.41% up vote form @spydo courtesy of @sisygoboom! I hope, my gratitude will help you getting more visibility.
You can also earn by making delegation. Click here to delegate to @spydo and earn 95% daily reward payout! Follow this link to know more about delegation benefits.

Your Post Has Been Featured on @Resteemable!
Feature any Steemit post using resteemit.com!
How It Works:
1. Take Any Steemit URL
2. Erase https://
3. Type re
Get Featured Instantly � Featured Posts are voted every 2.4hrs
Join the Curation Team Here | Vote Resteemable for Witness

Coin Marketplace

STEEM 0.22
TRX 0.25
JST 0.039
BTC 95428.83
ETH 3314.03
USDT 1.00
SBD 3.16