#### Repository https://github.com/MattyIce/bottracker #### What Will I Learn? Hello everyone Let's start today I'll show you how to make steembottracker's front run the bots with python this project name is firstup, thank you to @yasujizr who found the name of this project and idea of this project me ( @hakancelik ) and @captainsailor thank you cap. - You will learn python functions - You will learn steem-python library - You will learn requests and json python library - You will learn getting data from the internet with python #### Requirements - python 3.6 - [steem-python library](https://github.com/steemit/steem-python) #### Difficulty - Basic #### Tutorial Contents <center>  <sub>[Source ](https://steembottracker.com)</sub></center> ------ ## Let's start #### 1- Create a file called settings.py first we create a file called settings.py , into this file we will write our small settings for our bot. ``` from steem import Steem class Keys: accounts = [ {"username":"username","weight":100,"min_bid":20,"voting_power":80,"posting_key":"posting_key"}, ] keys = [account["posting_key"] for account in accounts] STEEM = Steem(nodes=['https://api.steemit.com'],keys = Keys.keys) MINUTE_MAX = 32 MINUTE_MIN = 30 ``` let me explain the codes - we first included our Steem library into our project - and created a class called Keys ,purpose of this class enter the accounts and some accounts' information. - You can add as many accounts as you want to the accounts variable - On this line ( STEEM = Steem(nodes=['https://api.steemit.com'],keys = Keys.keys)) We have set up the steem node and assigned the account keys - minute settings means that the minimum and maximum minutes information for our upvote -------- #### 2- Create a file called main.py - first we will use it in our project and add libraries and variables. ``` from steem.post import Post from steem.account import Account import requests import json import time from datetime import datetime, timedelta from settings import STEEM,Keys,MINUTE_MAX,MINUTE_MIN ``` - we will use API to attract bids sent to bots, [steembottracker api](https://steembottracker.net/posts) write a function for it name get_bids ``` def get_bids(): steembottrackerurl = "https://steembottracker.net/posts" r = requests.get(steembottrackerurl) for i in r.json(): yield dict( amount = i["amount"], currency = i["currency"], author = i["author"], permlink = i["permlink"], ) ``` - Now it's time to code up to get upvote ``` def upvote(post): voters_list = [i["voter"] for i in STEEM.get_active_votes(post.author, post.permlink)] post_url = "@"+post.author+"/"+post.permlink voted = {} for account in Keys.accounts: username = account["username"] weight = float(account["weight"]) output = {"status":False,"user":username,"note":"already voted","post_url":post_url} try: post.vote(weight,username) output.update(status = True,note = "voted") except: output.update(note = "Unknown") yield output ``` - and the last part that sends the upvote request, which looks at incoming offers, accounts, share times. ``` def run(): ready_users = [] for user in Keys.accounts: user_voting_power = Account(user["username"], steemd_instance = STEEM).voting_power() print("user_voting_power",user["username"],user_voting_power) if user_voting_power > user["voting_power"]: ready_users.append(user) for bid in get_bids(): for user in ready_users: if float(bid["amount"]) >= user["min_bid"]: post_url = "@"+bid["author"]+"/"+bid["permlink"] post = Post(post = post_url, steemd_instance = STEEM) post_time_elapse = post.time_elapsed() days = post_time_elapse.days seconds = post_time_elapse.seconds minute = round(seconds/60,4) if days == 0: print(user["username"],minute,post_url) if MINUTE_MAX < 32 and MINUTE_MIN >= 30: for up in upvote(post): yield up ``` #### Result <center></center> #### Proof of Work Done https://github.com/hakancelik96/firstup
author | hakancelik |
---|---|
permlink | firstup-how-can-i-make-steembottracker-s-front-run-the-bots-with-python |
category | utopian-io |
json_metadata | {"tags":["utopian-io","tutorial","python","steem"],"users":["yasujizr","hakancelik","captainsailor"],"image":["https://steembottracker.com/img/header_logo.png","https://resmim.net/f/pU9pYy.jpg?nocache"],"links":["https://github.com/MattyIce/bottracker","https://github.com/steemit/steem-python","https://steembottracker.com","https://api.steemit.com","https://steembottracker.net/posts","https://github.com/hakancelik96/firstup"],"app":"steemit/0.1","format":"markdown"} |
created | 2018-06-15 20:07:12 |
last_update | 2018-06-16 09:40:51 |
depth | 0 |
children | 10 |
last_payout | 2018-06-22 20:07:12 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.640 HBD |
curator_payout_value | 0.099 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 4,476 |
author_reputation | 15,102,487,166,852 |
root_title | "How can I make steembottracker's front run the bots with python" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 60,898,961 |
net_rshares | 295,891,426,399 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
delphia16 | 0 | 1,744,026,612 | 100% | ||
puffin | 0 | 1,641,456,770 | 100% | ||
yuxi | 0 | 2,675,024,119 | 10% | ||
pepe7777 | 0 | 811,069,367 | 100% | ||
steemitboard | 0 | 373,397,932 | 1% | ||
witnesess.doo | 0 | 841,955,270 | 100% | ||
shuler | 0 | 927,882,301 | 100% | ||
peuhaba2020 | 0 | 1,298,048,585 | 100% | ||
italianguy | 0 | 1,660,409,976 | 100% | ||
nicolelang | 0 | 1,483,427,440 | 100% | ||
tilenpirih | 0 | 1,321,260,937 | 100% | ||
veerall | 0 | 824,822,018 | 100% | ||
steemit-turkey | 0 | 9,053,861,782 | 20% | ||
minnowsupport | 0 | 47,287,268,981 | 0.75% | ||
sarmins | 0 | 731,937,726 | 100% | ||
mrblu | 0 | 1,621,397,010 | 100% | ||
nairamallam | 0 | 695,314,988 | 100% | ||
onejoe | 0 | 1,665,199,024 | 100% | ||
simba20 | 0 | 1,338,679,141 | 100% | ||
st3llar | 0 | 633,961,492 | 3% | ||
didiblack | 0 | 1,677,566,356 | 100% | ||
yahqan | 0 | 1,588,915,184 | 100% | ||
paramon | 0 | 1,095,371,362 | 100% | ||
leir | 0 | 706,036,184 | 20% | ||
cwen | 0 | 1,603,139,133 | 100% | ||
paquetedecuba | 0 | 1,433,872,909 | 100% | ||
strefanetu | 0 | 1,370,237,097 | 100% | ||
mrwildenfree | 0 | 1,472,877,617 | 100% | ||
ews | 0 | 1,466,320,416 | 100% | ||
rexlito | 0 | 789,491,706 | 100% | ||
murattatar | 0 | 1,959,132,267 | 8% | ||
achmadyani | 0 | 1,477,460,066 | 100% | ||
learnandteach01 | 0 | 367,194,983 | 100% | ||
astrizak | 0 | 1,354,470,863 | 100% | ||
jaff8 | 0 | 59,468,124,157 | 100% | ||
xee95 | 0 | 1,455,623,402 | 100% | ||
rockymtnsteem | 0 | 1,300,757,043 | 100% | ||
yorkchinese | 0 | 82,277,351 | 1% | ||
raci | 0 | 1,789,210,997 | 100% | ||
coral-reef | 0 | 1,598,069,925 | 100% | ||
steemitstats | 0 | 3,635,922,194 | 5% | ||
silasdavid | 0 | 1,611,559,897 | 100% | ||
nikkicole | 0 | 1,321,930,908 | 100% | ||
sudi | 0 | 1,496,833,436 | 100% | ||
saoirseronan | 0 | 1,070,309,805 | 100% | ||
daniel-irala | 0 | 837,012,755 | 100% | ||
hardrockebab | 0 | 936,933,469 | 100% | ||
engrbrain1 | 0 | 1,381,826,444 | 100% | ||
thecottage.che | 0 | 1,350,275,307 | 100% | ||
tdre | 0 | 30,509,749,861 | 66% | ||
neru | 0 | 1,070,126,617 | 100% | ||
jun04035 | 0 | 841,224,043 | 100% | ||
nikita.pobazhak | 0 | 1,264,875,834 | 100% | ||
susano | 0 | 1,299,536,509 | 100% | ||
kujou | 0 | 2,100,261,487 | 100% | ||
hoangmanhcuong | 0 | 828,376,579 | 100% | ||
waltliquor | 0 | 867,856,870 | 100% | ||
robertmannino | 0 | 952,417,164 | 100% | ||
neneandy | 0 | 1,637,644,152 | 100% | ||
mashwanii | 0 | 830,572,087 | 100% | ||
inspectorschelle | 0 | 1,636,433,561 | 100% | ||
fisker | 0 | 968,738,720 | 100% | ||
dongentle2 | 0 | 1,617,810,135 | 100% | ||
crcs2o4 | 0 | 773,389,963 | 100% | ||
afrosiab | 0 | 1,653,305,322 | 100% | ||
snackaholic | 0 | 8,640,248,028 | 100% | ||
zaggysteem | 0 | 948,119,569 | 100% | ||
charliekerper | 0 | 1,640,607,187 | 100% | ||
mrelliwood | 0 | 1,625,776,035 | 100% | ||
yemi90210 | 0 | 1,646,286,541 | 100% | ||
xsorbik | 0 | 1,337,177,039 | 100% | ||
cryptoscout | 0 | 1,512,982,594 | 100% | ||
inspiredgideon1 | 0 | 1,312,188,270 | 100% | ||
colicoid | 0 | 1,384,069,165 | 100% | ||
toni2oni | 0 | 1,268,585,479 | 100% | ||
fireonxas | 0 | 1,587,445,939 | 100% | ||
hakancelik | 0 | 6,388,533,451 | 100% | ||
samiun | 0 | 1,099,408,919 | 100% | ||
ivan78 | 0 | 961,329,577 | 100% | ||
jospig | 0 | 1,608,834,948 | 100% | ||
yasujizr | 0 | 3,979,102,545 | 100% | ||
ajcordenete | 0 | 945,235,870 | 100% | ||
coogger | 0 | 1,988,481,354 | 100% | ||
sawyn | 0 | 792,625,001 | 100% | ||
morice | 0 | 655,864,315 | 100% | ||
bigboycrafts | 0 | 893,774,917 | 100% | ||
sisirhasan | 0 | 971,787,925 | 100% | ||
geniusmind | 0 | 1,033,359,517 | 100% | ||
anikpaul52 | 0 | 1,366,571,822 | 100% | ||
zamazingo1898 | 0 | 1,536,613,402 | 100% | ||
fishhead | 0 | 1,344,035,506 | 100% | ||
riesaxon | 0 | 1,331,532,221 | 100% | ||
albatar | 0 | 1,475,932,866 | 100% | ||
maddieseal | 0 | 766,377,461 | 100% | ||
aro.steem | 0 | 1,166,670,365 | 100% | ||
vaquita | 0 | 682,973,759 | 100% | ||
evanpetzer | 0 | 1,496,834,601 | 100% | ||
thecryptopreneur | 0 | 1,442,073,043 | 100% | ||
autumnflower | 0 | 1,395,579,073 | 100% | ||
konradxxx3 | 0 | 1,234,772,266 | 100% | ||
jibupune | 0 | 1,297,934,122 | 100% | ||
mlekotosamozlo | 0 | 577,215,981 | 100% | ||
strategema | 0 | 1,709,786,971 | 100% | ||
tethre | 0 | 1,286,722,003 | 100% | ||
radikal | 0 | 1,327,318,629 | 100% | ||
jason.che | 0 | 1,351,898,963 | 100% | ||
joserafaelhf | 0 | 1,653,136,992 | 100% | ||
mahsumclkblk | 0 | 609,521,693 | 100% | ||
cebunick | 0 | 1,434,626,867 | 100% |
Is this meant to be a tutorial?
author | amosbastian |
---|---|
permlink | re-hakancelik-firstup-how-can-i-make-steembottracker-s-front-run-the-bots-with-python-20180615t233039448z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-06-15 23:30:39 |
last_update | 2018-06-15 23:30:39 |
depth | 1 |
children | 5 |
last_payout | 2018-06-22 23:30:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 31 |
author_reputation | 174,473,586,900,705 |
root_title | "How can I make steembottracker's front run the bots with python" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 60,915,478 |
net_rshares | 0 |
partly, I wanted to teach you a little that I developing so it is development but at the same time tutorial content ,Is it a bad idea ?
author | hakancelik |
---|---|
permlink | re-amosbastian-re-hakancelik-firstup-how-can-i-make-steembottracker-s-front-run-the-bots-with-python-20180615t233822112z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-06-15 23:38:21 |
last_update | 2018-06-15 23:38:21 |
depth | 2 |
children | 4 |
last_payout | 2018-06-22 23:38:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 136 |
author_reputation | 15,102,487,166,852 |
root_title | "How can I make steembottracker's front run the bots with python" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 0 |
post_id | 60,916,051 |
net_rshares | 0 |
I think this is probably best suited to the tutorial category, but you would more than likely need to change some things to suit that category's guidelines (but it's up to you if you want to keep it as a development contribution).
author | amosbastian |
---|---|
permlink | re-hakancelik-re-amosbastian-re-hakancelik-firstup-how-can-i-make-steembottracker-s-front-run-the-bots-with-python-20180615t235103922z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-06-15 23:51:03 |
last_update | 2018-06-15 23:51:03 |
depth | 3 |
children | 3 |
last_payout | 2018-06-22 23:51:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 230 |
author_reputation | 174,473,586,900,705 |
root_title | "How can I make steembottracker's front run the bots with python" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 60,916,960 |
net_rshares | 0 |
<p>Congratulations! This post has been upvoted from the communal account, @minnowsupport, by hakancelik from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the <a href="https://discord.gg/HYj4yvw"> Peace, Abundance, and Liberty Network (PALnet) Discord Channel</a>. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.</p> <p>If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=minnowsupport&vesting_shares=102530.639667%20VESTS">50SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=minnowsupport&vesting_shares=205303.639667%20VESTS">100SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=minnowsupport&vesting_shares=514303.639667%20VESTS">250SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=minnowsupport&vesting_shares=1025303.639667%20VESTS">500SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=minnowsupport&vesting_shares=2053030.639667%20VESTS">1000SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=minnowsupport&vesting_shares=10253030.639667%20VESTS">5000SP</a>. <br><strong>Be sure to leave at least 50SP undelegated on your account.</strong></p>
author | minnowsupport |
---|---|
permlink | re-firstup-how-can-i-make-steembottracker-s-front-run-the-bots-with-python-20180615t203950z |
category | utopian-io |
json_metadata | "{"app": "beem/0.19.23"}" |
created | 2018-06-15 20:39:51 |
last_update | 2018-06-15 20:39:51 |
depth | 1 |
children | 0 |
last_payout | 2018-06-22 20:39:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,706 |
author_reputation | 148,902,805,319,183 |
root_title | "How can I make steembottracker's front run the bots with python" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 60,901,820 |
net_rshares | 0 |
Thank you for your contribution. - Doesn´t follow the template for tutorials. See the template <a href="https://github.com/utopian-io/editor-templates/blob/master/tutorials">here</a>. See in this <a href="https://steemit.com/utopian-io/@espoem/make-your-posts-look-great-in-steemit-and-busy">link</a> an example of a good tutorial. ---- Need help? Write a ticket on https://support.utopian.io/. Chat with us on [Discord](https://discord.gg/uTyJkNm). [[utopian-moderator]](https://join.utopian.io/)
author | portugalcoin |
---|---|
permlink | re-hakancelik-firstup-how-can-i-make-steembottracker-s-front-run-the-bots-with-python-20180616t011412786z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"links":["https://github.com/utopian-io/editor-templates/blob/master/tutorials","https://steemit.com/utopian-io/@espoem/make-your-posts-look-great-in-steemit-and-busy","https://support.utopian.io/","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"} |
created | 2018-06-16 01:14:12 |
last_update | 2018-06-16 01:14:12 |
depth | 1 |
children | 1 |
last_payout | 2018-06-23 01:14:12 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 503 |
author_reputation | 604,275,985,631,545 |
root_title | "How can I make steembottracker's front run the bots with python" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 60,922,815 |
net_rshares | 0 |
This is my first tutorial content ,I edited the tutorial,Is there any possibility of reviewing the content again ?
author | hakancelik |
---|---|
permlink | re-portugalcoin-re-hakancelik-firstup-how-can-i-make-steembottracker-s-front-run-the-bots-with-python-20180616t092618296z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-06-16 09:26:18 |
last_update | 2018-06-16 09:26:18 |
depth | 2 |
children | 0 |
last_payout | 2018-06-23 09:26:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 114 |
author_reputation | 15,102,487,166,852 |
root_title | "How can I make steembottracker's front run the bots with python" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 60,959,555 |
net_rshares | 0 |
Congratulations @hakancelik! You have completed some achievement on Steemit and have been rewarded with new badge(s) : [](http://steemitboard.com/@hakancelik) Award for the number of posts published <sub>_Click on the badge to view your Board of Honor._</sub> <sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub> To support your work, I also upvoted your post! **Do not miss the [last post](https://steemit.com/steemitboard/@steemitboard/steemitboard-world-cup-contest-croatia-vs-nigeria) from @steemitboard!** --- **Participate in the [SteemitBoard World Cup Contest](https://steemit.com/steemitboard/@steemitboard/steemitboard-world-cup-contest-collect-badges-and-win-free-sbd)!** Collect World Cup badges and win free SBD Support the Gold Sponsors of the contest: [@good-karma](https://v2.steemconnect.com/sign/account-witness-vote?witness=good-karma&approve=1) and [@lukestokes](https://v2.steemconnect.com/sign/account-witness-vote?witness=lukestokes.mhth&approve=1) --- > Do you like [SteemitBoard's project](https://steemit.com/@steemitboard)? Then **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!
author | steemitboard |
---|---|
permlink | steemitboard-notify-hakancelik-20180616t022232000z |
category | utopian-io |
json_metadata | {"image":["https://steemitboard.com/img/notify.png"]} |
created | 2018-06-16 02:22:30 |
last_update | 2018-06-16 02:22:30 |
depth | 1 |
children | 0 |
last_payout | 2018-06-23 02:22:30 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,340 |
author_reputation | 38,975,615,169,260 |
root_title | "How can I make steembottracker's front run the bots with python" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 60,928,115 |
net_rshares | 0 |