Send Auto SBD [with Python]

in #utopian-io6 years ago (edited)

1-2 days ago I wrote an SBD Alert Program. Then I thought, "Why is it just an alarm?" This time I also wrote an Automatic SBD Sending code. You can combine the two if you want ;)


You can see it in action ;)



## SBD_Auto_Send
Auto Send Steem Dollars to BitTrex or Others Peoples/Exchanges

--!-- WARNING! --!--

YOU MUST, FIRST TRY WITH yesreal=0
WHILE SETUP OR CONFIGURATION
YOU MAY LOSE SBD/STEEM
!! ALL RESPONSIBILITIES YOUR OWN !!

Setup

  • Download Python (only tested on 2.7.x)
    We need these modules
  • requests
  • re
  • time
  • selenium
  • win32api, win32con
  • pyperclip
    And ChromeWebDriver

Use

  • Write your user name and key

s1.jpg

  • If you don't have current Redeem Rewards, You Sould change div[5] to div[4] in Line #99
    ree.jpg

  • Run ;)

  • For real working: should be yesreal=1 !! ALL RESPONSIBILITIES YOUR OWN !!



'''
Sbd Alert v1
by Murat Tatar
January 2018

--!-- WARNING! --!--
YOU MUST, FIRST TRY WITH yesreal ==0
WHILE SETUP OR CONFIGURATION
YOU MAY LOSE SBD/STEEM
!! ALL RESPONSIBILITIES YOUR OWN !!

'''

''' # import needed moduls '''
import os
import requests
import re
import time
from selenium import webdriver as web
from selenium.webdriver.common.keys import Keys
import win32api, win32con
from controls import *
import pyperclip

'''
--!-- WARNING! --!--
YOU MUST, FIRST TRY WITH yesreal = 0
WHILE SETUP OR CONFIGURATION
YOU MAY LOSE SBD/STEEM
!! ALL RESPONSIBILITIES YOUR OWN !!
'''

yesreal = 0

''' # steemit user name and private key '''
user = 'murattatar'
prv_key = 'P5TaJB1k1BuXbeN1mKeY1mDEG1LjmN9xfz75y8uvB8ekMV6vX6'

''' # for SBD wallet '''
toexchange = 'bittrex'
memo = '71d09fa0ea954f3a9d2'

''' #################################################### '''

def e():
exit()

''' ## Auto Sell SBD @ BitTrex ################################ '''

''' # Login into Steemit '''

page = web.Chrome("chromedriver.exe")
url = 'https://steemit.com/login.html'
page.get(url)
page.implicitly_wait(30)
page.set_window_position(0,0)
page.set_window_size(1360, 768)

userbox = page.find_element_by_name('username')
userbox.send_keys(user) # user 'murattatar'
time.sleep(.2)
keybox = page.find_element_by_name('password')
keybox.send_keys(prv_key)
time.sleep(.2)
butonSL = page.find_element_by_xpath(".//button[@type='submit']")
time.sleep(.2)
keybox.send_keys(Keys.RETURN)
time.sleep(2)

url = 'https://steemit.com/@'+user+'/transfers'
page.get(url)
time.sleep(2)
page.implicitly_wait(30)

''' # find element created via javasctipt that there is not in ctrl+u '''
js_code = '''
b = document.getElementsByTagName('button');
return b
'''

redembutton = page.execute_script(js_code)
print redembutton

for btn in redembutton:
element_text = btn.text
if element_text == 'BUY STEEM OR STEEM POWER':
''' # Redeem Rewards (Transfer To Balance) '''
''' # You Sould div[5] to div[4] '''
sbdbutton = page.find_element_by_xpath('.//div[@class="UserWallet"]/div[5]/div/span')
sbdbutton.click()
transferbutton = page.find_element_by_link_text('Transfer')
transferbutton.click()
time.sleep(1)
''' # fill "to" '''
Cliq(900,405)
pyperclip.copy(toexchange)
PressHoldRelease('ctrl', 'v')
Cliq(715,225)
''' # fill "amount" '''
time.sleep(1)
if yesreal ==1:
Cliq(515,500)
else:
Cliq(503,463); Write('0.001')
''' # fill "memo" '''
time.sleep(1)
Cliq(515,584)
time.sleep(1)
pyperclip.copy(memo)
PressHoldRelease('ctrl', 'v')
time.sleep(1)
Press('enter')
time.sleep(1)
Cliq(650,380)
pyperclip.copy(prv_key)
PressHoldRelease('ctrl', 'v')
Press('enter')
e()



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Your contribution cannot be approved because it does not follow the Utopian Rules.

Your project is too simple and has more the character of a textbook example. This kind of projects can't be accepted on Utopian. Also there are some issues with the quality of your GitHub repository.

Additional notes:

  1. The code quality/formatting can be improved, and there is a private key in the code.
  2. You don't need to re-invent the wheel as these can be done with a few lines of of the Steem Python library.

You can contact us on Discord.
[utopian-moderator]

  • I cant install Steem Python because its need Python 3,
    And can't install Python 3 because its' a lot moduls need 64bit windows.
    I think there are so many people who are in such a situation and who use 2.7.

  • It is of course not my password

Hey @justyy, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!

Güzel çalışma olmuş eline sağlık.

Işe yarar mi acaba denesem m bilemedim :/ ama uğraşılmış belli emeğinize sağlık:)))

You got a 8.40% upvote from @minnowvotes thanks to @murattatar!

Coin Marketplace

STEEM 0.21
TRX 0.12
JST 0.029
BTC 66303.73
ETH 3592.29
USDT 1.00
SBD 2.61