Mini Bid Bot

in #upvotes7 years ago (edited)

Did you ever want to run your own bid bot?
Wait no longer. Here is a small script for a very simple bid bot. No refunds.
(Delegation not included:))

Requirements:

python with steem installed
steempy with user in wallet
This script should run via crontab every x minutes.

Script

import datetime
import time
import os
from dateutil import parser
from steem import Steem
from steem.account import Account
from steem.post import Post
print(time.strftime("%a, %d %b %Y %H:%M:%S +0000",time.localtime()),flush=True) 
username = 'my_bid_bot' #bot username
walletpw = 'my_wallet_pw' #password for your steempy wallet
vote_interval = 144 #minutes between votes 2.4h = 144 minutes
wf = 1 #weight factor: set this to 1 if you vote 100% every vote interval, or 0.5 if 50% every vote interval, etc...
s = Steem()
now = parser.parse(str(datetime.datetime.utcnow())+' UTC') 
maccount = Account(username,s)
last_vote = parser.parse(maccount['last_vote_time']+' UTC')
if  now-last_vote >= datetime.timedelta(minutes=vote_interval):
    hrs = maccount.history_reverse(filter_by='transfer')
    allt = 0.0
    voting ={}
    for x in hrs:
        mytime = parser.parse(x['timestamp']+' UTC')
        if mytime<last_vote:
            break
        if x['to'] == username:
            tr = float(x['amount'].split(' ')[0])
            memol = x['memo'].split('@')
            if memol >1:
                allt += tr
                memo = memol[1]
                if memo not in voting:
                    voting[memo]=0
                voting[memo] +=tr
            
    total_bid = allt
    os.environ["UNLOCK"] = walletpw
    for memo in voting:
        try:
            post = Post('@'+memo,s)
            weight = wf* voting['memo']*100.0/tr
            post.vote(weight=weight,voter=username)
        except:
            pass 
Sort:  

Great post, I like it.

I'm sorry
I'm not understand @isnochys

great how is run? check your wallet

Can you HELP me?
Friends how i can SBD send to multiple people at a time? Suppose I want to gift some SBD to my friends/followers. I want to send sbd to 50 friends/followers so How I can do that with one click. # Can help me.

The @OriginalWorks bot has determined this post by @isnochys to be original material and upvoted(1.5%) it!

ezgif.com-resize.gif

To call @OriginalWorks, simply reply to any post with @originalworks or !originalworks in your message!

Coin Marketplace

STEEM 0.18
TRX 0.13
JST 0.028
BTC 64668.46
ETH 3173.45
USDT 1.00
SBD 2.58