Dear Steemians,
Upvote bot in less than 10 lines of code
from piston.steem import Steem
import os
import json
steem = Steem(wif=os.environ["WIF"])
authors = json.loads(os.environ["AUTHORS"])
for c in steem.stream_comments():
if c["author"] in authors:
print(c.upvote())
It reqquires that you put your WIF key and JSON list of AUTHORS into an
environmental variable:
export WIF="<wif-posting-key>" AUTHORS='["xeroc", "dantheman", "ned", "arhag"]'
Note
This currently requries that you install the python-steem library as well as piston from the development branch.
Have fun!
Everyone be like "This is bad, you shouldn't upvote indiscriminately! Y U luv spam, xeroc??" but am I the only one saying "Pardon me, but put your WIF in an environment variable??" ;)
And this is a brilliant hello-world style example of the power and expressiveness of this library. Great work!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Yes, this.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Pardon my ignorance, I'm kind of new, and not all up with what you're trying to say. So it's not a good thing to put your WIF in the environment variable or is it a good thing?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
It would be better if you simply write it in a text file or directly in source code.
When writing in environment variables your whole OS and all programs can find and read it really easy. So could viruses and such things do. And you will probably forget the key in your system when moving the bot to another system.
It's simply a security issue.
That is my answer. There are surely many more reasons.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hey @xeroc, love your stuff but I found a small bug with this logic:
This will be true for substring matches in authors.
So if
authors
contains a name such as "longtestname"and
c["author"]
contains a name such as "name" or "test"It will evaluate as true
(Python is still new for me)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks for taking a closer look, but since this expression
evaluates to
False
in python, I'd say that python interprets all elements ofauthors
independently and in full. That's becauseauthors
is an array or list.If it was just a single author then you would be right since
evaluates to
True
Agreed?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Just tested this more and found out what the error was:
If you include the single quotes around the array, both statements return True
But if you remove the single quotes around the array, it functions as intended:
Hope this helps!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
In the first case, the
stringList
is actually a simple string and is not interpreted as an array. that's why the test returns true in both cases.Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
As much as I like bots and automating things, once an author knows they have certain users "bot voting" for them, they can start to "spam up" inferior content and still be assured of the votes. Also bot users will be favored to get the first couple and most valuable up-votes in. This could be very frustrating for the non-bot community or authors not on the bot list.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Voting is just "one" thing to automate.
You could automate anything with a library like this
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Can't the bot scan the text for key words?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
It can:
https://steemit.com/steem/@xeroc/notification-bot-for-steem-in-30-lines-of-code
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
This is not good for the system really. To be clear I'm not "blaming" you - people will do what they have to do given a certain rule set. It's just that the system needs to tweak the incentives so that scripted participation, instead of human judgement in terms of quality, is not rewarded. Otherwise what's the point?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I agree with "voting bots" not bringing value. The purpose of this post was to show how easy it is to write one with the new libs.
Technically, you could write any kind of bot with this!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I suppose you could vote first, ask questions later and remove vote if you don't like it.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Forgive a non-techie question. Given two or more users employing the same bot for quick action, which one gets in first? Does it matter where your computer is located and how fast your network speed is, etc.?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Very good questions!!
In fact it depends on who gets his transaction to the next block signer the fastest. That depends on your connectivity and the distance to the next block producer. However, since you don't know the distance to the next block producer and them being spread around the world, it mostly comes down to luck :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I have several accounts and each time I post I have to log into each one to up-vote my post, so this bot its actually very usefull.. Thanks xeroc!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Wanna to vote against the voting bots. Sorry.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Wow! Few lines of killer bot, thanks mate.. 🙂
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
It seems your packages have no wheels.
edit:
Nevermind I think I got it
We don't need wheels because we don't need roads where we're going.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks man. I really appreciate the time you took to write this library!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
can i setup this from windows 8.1 ? or only from linux?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Why make it easier for people to bring vote quality down? If someone else wants to write their own anti-social bot, they can do it themselves.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
The purpose of this post was to show people how easy it has become to write such a bot.
It could do way more than just upvote posts.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
The bot can have utility. It can take an article written in one language and translate it to another then post it on Steem.
So for example a person writes an article in Chinese and the bot downloads the text, runs it through a translator process, then uploads the English version. The whole thing can be automated or humans can be rewarded to translate.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
That looks like Greek to me. I want to create an upvote bot. Can someone help me? Email me on [email protected] thanks
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Here is an Archive of Cryptocurrency App building Code on Github for anyone creating a Steemit app
https://steemit.com/steem/@marsresident/github-cryptocurrency-app-creation-archive
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit