Hello Steemit,
this is the second part of the series "how @wang is doing it"
You can read the first post here https://steemit.com/hacking/@seagul/steemit-vote-bot-like-wang-for-introduceyourself
Like i said in my first post, i will publish the post bot for the introduceyourself section
Full python code for post on every new post @introduceyourself
import time
from steemapi.steemnoderpc import SteemNodeRPC
from steembase import transactions
currentTime = int(time.time())
message = "Welcome to Steemit!"
user = "yourUserName"
wif = "yourWifKey"
category = "introduceyourself"
rpc = SteemNodeRPC("wss://steemit.com/wstmp3")
for post in rpc.stream("comment", start=currentTime):
if post["parent_author"] == '' and post["parent_permlink"] == category:
try:
expiration = transactions.formatTimeFromNow(60)
op = transactions.Comment(
**{"parent_author": post["author"],
"parent_permlink": post["permlink"],
"author": user,
"permlink": post["permlink"],
"title": "",
"body": message,
"json_metadata": ""}
)
ops = [transactions.Operation(op)]
ref_block_num, ref_block_prefix = transactions.getBlockParams(rpc)
tx = transactions.Signed_Transaction(
ref_block_num=ref_block_num,
ref_block_prefix=ref_block_prefix,
expiration=expiration,
operations=ops)
tx = tx.sign([wif])
tx = transactions.JsonObj(tx)
rpc.broadcast_transaction(tx, api="network_broadcast")
print("Posted!")
print(post["title"])
except Exception:
print("Oops! Posting")
This script will write "Welcome to Steemit!" under each new post in the introduceyourself section.
@wang was a little bit more creative and has done a [multiline string] message. Example: http://stackoverflow.com/a/10660443
Was watching this account too.
i was sure its a bot.
thanks for sharing this.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
It would be quite easy to downvote every post from @wang in @introduceyourself
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
i am not sure about the actual meaning of it beeing a bot. so i dont want to do this.
but it feels nice to see that somebody like you is into it to let me see clear about my guess if this was a bot. even without investigation.
/the beautiful part is, i can decide to pay you and not@wang because we are steemeans.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
we should be nice to @wang as long as it tries to be a nice bot and help beginners :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
It would be nice to know if its a bot
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Upvoted. Eventually all of the Bots being created here are going to start some pretty cool projects. People are going to keep building and building. There was another Bot posts the other day, linked below
https://steemit.com/steem/@curator/i-made-a-curation-bot-for-steem
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
The information is very interesting. As the presenter of this info, I'm curious if you have any words of advice on how to use a bot responsibly
I appreciate good bots if they are used right.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
great post, can i change the section by changing the introduceyourself tag?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
You can change the section yes
instead of category = "introduceyourself" you can write category = "steemit"
Than you would post on every new post in steemit
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
It's That was still Bot
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
It would be so nice to get 50+ times "Welcome to Steemit!" as comments in your introduction post. :D
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Indeed ;)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
@seagul Is there a way for the script to check if your last vote or comment was made within the last 20 seconds before trying to post anything new?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hello @soupernerd,
you just need to set a start time and check with a "if", if time elapsed is <20
Example: http://stackoverflow.com/questions/3620943/measuring-elapsed-time-with-the-time-module
start_time = time.time()
elapsed_time = time.time() - start_time
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hi seagul,
What I was actually wondering is this. Steemit seems to throw an error if you try to comment too fast.
Example of the steem error:
"(now - auth.last_post) > STEEMIT_MIN_REPLY_INTERVAL: You may only comment once every 20 seconds"
Is there a way to check against steemit itself, if your last post was within the last 20 seconds? So instead of just checking against elapsed time generally, checking against whatever it is steemit is checking?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I AGREE! Thank you for posting. Hope you get this to snowball to the top!
I up-voted you too... BTW, should steemit let us steemers advertise using steem? Be sure to tell everyone you know to come vote here at: https://steemit.com/steemit/@kingtylervvs/if-steemit-ever-does-decide-to-advertise-there-is-only-1-way-it-could-work-in-my-opinion-debate
This is a democratic community decision.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hi @seagul! I'm getting this error when trying to run it:
{\rtf1\ansi\ansicpg1252\cocoartf1348\cocoasubrtf170
SyntaxError: unexpected character after line continuation character
Any ideas? Warning, I have no idea what I'm doing!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I'm a noob when it comes to this stuff. Where wouls i put such a code and how would i run it?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
You need an python environment and the python-steemlib from @xeroc.
For installation you can read: https://github.com/xeroc/python-steemlib
Than you simply create the file with my code and run it like:
(Ofcause you need to change the "username"and the "wif" key)
python3 fileName.py
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks for posting this! I'm replying as a bookmark.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
SteemNodeRPC look like not able to be imported ... Traceback (most recent call last):
File "./post_test.py", line 2, in
from steemapi.steemnoderpc import SteemNodeRPC
ImportError: No module named steemapi.steemnoderpc
ubuntu@ubuntu:~/steem/extract$
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
You need to install the library.
"pip3 install steem"
Installation guide: https://github.com/xeroc/python-steemlib
You need to use python3
Try
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
hi, im getting same error, using python3 on ubuntu
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
thanks.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
if i am running a local node . Can i switch following line to local node and what the syntax could be
rpc = SteemNodeRPC("wss://steemit.com/wstmp3")
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Something like rpc = SteemNodeRPC("ws://localhost:8090") maybe
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
thanks
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
great work
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
thanks for sharing this tho
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Nice work!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
It's kinda fucked up that we have to write bots because the developers are too lazy (or busy?) to write a much needed FAQ.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Much needed FAQ here:
https://steemit.com/steemit/@intelliguy/steemit-faq-frequently-asked-questions-common-myths-and-misconceptions
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Yeah found it yesterday, but thanks :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
not working .. have install xero's steem lib....
Traceback (most recent call last):
File "./post_test.py", line 2, in
from steemapi.steemnoderpc import SteemNodeRPC
ImportError: No module named steemapi.steemnoderpc
ubuntu@ubuntu:~/steem/extract$
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
You need to use "python3".
Have you installed the library for pip3?
Try
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I'm using Windows and had the same problem. For some reason PYTHONPATH didn't have the default directory for all my python packages listed.
At the top of your "post_test.py" file put:
import sys
print(sys.path)
That will tell you what PYTHONPATH is searching through for imports. Use ."append" to add the location of your steemapi folder. For me that was:
import sys
sys.path.append("C:\Python34\Lib\site-packages")
print(sys.path)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
whoa, you are allowed to do bots here?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit