Daily Steem-Python Challenge, Win 1 Steem!

in #contest7 years ago (edited)

For each tutorial we release there will be a relevant challenge where the winner receives 1 STEEM!

Challenge

Today's challenge is relatively simple. Take the code from the tutorial from here and change it to be able to do the following

  1. Instead of just replying to whoever mentions the username (change it to your own for example), also upvote them, but only if it's a post and not a comment.

That's it! Good luck to everyone participating!

Deadline

The prize money will be rewarded to the person that solves the problem first. If there is no solution within 7 days after this post has been submitted the prize pool expires.

Relevant Tutorial

Part 6: How To Automatically Reply To Mentions Using Steem-Python


If you have questions about the tutorial or the challenge then don't hesitate to comment below or contact us on Discord!

Sort:  

Thanks for the contest. Here is my solution. :)

I tried your code and something different yesterday and I always get this error, would you happen to have idea what may be wrong on my side (using Linux and venv, py 3.6)

WARNING:urllib3.connectionpool:Retrying (Retry(total=19, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7ff791635630>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /

@veleje

That's because the default node on the steem-python is dead. Have a look at the first or second post in the series. @amosbastian suggested there was a fix.

I use this workaround in my own projects.

Thank you. I'm not sure what exactly i should do, I'm beginner with Python.
I replaced:
steem = Steem()
with:
steem = Steem(nodes=["https://api.steemit.com", "https://rpc.buildteam.io"])
But I'm getting the same error.

steem = Steem(nodes=["https://api.steemit.com", "https://rpc.buildteam.io"])

this works for me.

Guess we are going to have to make the challenges a bit more difficult if you are participating! Congratulations once again, just sent you the reward!

Thanks.

Guess we are going to have to make the challenges a bit more difficult if you are participating!

Well, I will be waiting for the next one! :) bring it on.

I suggest for starter to maybe create another post, with the title Steemit workaround for 5 years old with all the needed details, that beginner needs.

Anything you guys posted so far I tried and I can't get Steemit-python to work for me any more.

I made fresh virtual environment (py 3.62), edited requirements.txt (toml==0.9.3), using:
"steem = Steem(nodes=["https://api.steemit.com", "https://rpc.buildteam.io"])"

...and nothing works.

Btw, using Linux (Manjaro) but there is no "libssl-dev" or "libssl" available in repositories.
But I installed "scrypt" and "python-scrypt"

It shouldn't be that complicated, it shouldn't be that hard because of some upgrades Steemit did.

Did you try typing steempy set nodes https://rpc.steemviz.com in your terminal (as mentioned in part 1 of this series)? If it still doesn't work then join our Discord and I'll help you out when I get back from the gym!

Thank you, I tried yesterday and I got some error.
But I just uninstalled steem and replaced it with:

pip install -U git+git://github.com/Netherdrake/steem-python

And some of my problems are solved. One code (start following a member) is working, so finally I'm having the progress. Thank you for your reply. I may come there later if I'm still going to struggle with anything.

If you are still having issues it is generally quicker to contact us on Discord

what a great idea, go on guys

Coin Marketplace

STEEM 0.18
TRX 0.16
JST 0.030
BTC 68425.65
ETH 2646.01
USDT 1.00
SBD 2.68