Easy Steem Dollar Alert [with Python]

in #utopian-io7 years ago (edited)

Almost every day we look at what the SBD price is. If the price is high, we do not want to miss a profit opportunity.

Personally, however, I missed such an opportunity when I was dealing with other things in Steemit. I wrote a short code in python to avoid the same thing.

and yes, I'm sharing it as open source ;) //w MIT License
https://github.com/murattatar/Easy-SBD-Alert

You can see demo html


 

easy.jpg

 

Easy-SBD-Alert

Easy Steem Dollars (SBD) Alert with sound

You can use Easy SBD Alert tool (11 KB)

Setup

  • Download Python (only tested on 2.7.x)

  • pip install os

  • pip install requests

  • pip install re

  • pip install time

  • Download and run 4t Tray Minimizer

Use

  • Write your SBD price level into _alert_level.txt

  • Write your check time (minutes) into _check_every_N_minutes.txt

  • Double Click on sbd_alert.py

  • Minimize it with 4t Tray Minimizer
    Thats it!

Never miss good price for Steem Dollars ;)


Easy Codes:



''' ##################
''' # Sbd Alert v1
''' # by Murat Tatar
''' # January 2018
''' ################### '''

import os
import requests
import re
import time

def e():
exit()

'''# catch the requested word '''
def Between(bas,son,cumle):
b1 = cumle.split(bas)
b2 = b1[1].split(son)
ar = b2[0]
return ar

o = open('_alert_level.txt'); oi= o.read(); o.close();
alertLevel = float(oi)

o = open('_check_every_N_minutes.txt'); oi= o.read(); o.close();
checkTime = int(oi)
print alertLevel

''' ## BitTrex SBD ##############'''

def CheckSBD():
url = "https://coinmarketcap.com/currencies/steem-dollars/#markets"
bring = requests.get(url)
arrival = bring.content # content into arrival

''' # find the SBD price in arrival, that means coinmarketcap's web page source codes '''
bitSbd1 = Between('Bittrex','Recently',arrival);
bitSbd2 = Between('price','',bitSbd1)
bitSbd = Between('$','',bitSbd2)

bitSbd = float(bitSbd) # convert string to float

print bitSbd
return bitSbd

''' # prepare HTML file '''
html = '''

Hey! SBD is over $''' + str(CheckSBD()) + '''


Hey! SBD is over $''' + str(CheckSBD()) +'''
You should check it
gif from here
easy sbd alert by Murat Tatar
'''

''' Run Forest! '''
''' # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ '''
while 1:
sbdnow = CheckSBD() # Check SBD price
if sbdnow > alertLevel: # If current SBD price bigger than alert level
o = open("alert.html","w"); o.write(html.encode("utf-8")); o.close() # create alert.html
os.startfile("alert.html") # open alert.html

time.sleep(checkTime*60) ## covert from minute to second and wait




Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

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

Good Job !

Can we reach it also via crowdin? If yes, I want to translate it ;)

There are ~100 words yet thats not enough for utopian. However I can start project on crowdin. We are always translating from there, this time I should learn how to start project ;)

Hey @murattatar I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.18
TRX 0.16
JST 0.029
BTC 62404.06
ETH 2426.64
USDT 1.00
SBD 2.65