Models | Examples |
---|---|
Display ads | Yahoo! |
Search ads |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if __name__ == '__main__': | |
my_exchange = input("Your exchange:") | |
starting_price = input("Bitcoin starting price:") | |
amount = input("Bitcoin amount:") | |
currency = input("Your currency (default USD):") | |
check_every = input("Check every (seconds):") | |
threshold = input("Choose to be notified when a certain limit is reached\n1) Percent limit: \n2) Amount limit: \n ") | |
limit_type = None | |
limit = 0 | |
if threshold == '1': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calc_percent_diff(now, base): | |
difference = now - base | |
return difference * 100 / base | |
def calculate_profits(cc, latest_bid, starting_price, amount, limit_type, limit): | |
difference = abs((latest_bid - starting_price) * amount) | |
single_diff = latest_bid - starting_price | |
if limit_type == 'percent': | |
percent_difference = calc_percent_diff(latest_bid, starting_price) | |
if percent_difference >= limit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "bitstamp", | |
"display_name": "Bitstamp", | |
"url": "https://bitstamp.net/", | |
"timestamp": 1493816831, | |
"data_source": "api", | |
"symbols": { | |
"XRPEUR": { | |
"last": 0.0513, | |
"volume": 5706005.4795, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def main(exchange, starting_price, amount, currency, limit_type, limit): | |
""" | |
:param exchange: The exchange where bitcoin was bought | |
:param starting_price: The price at which bitcoin was bought | |
:param amount: The amount of bitcoin | |
:param currency: The currency bitcoin was bought in | |
:param limit_type: The type of threshold, percent or amount | |
:param limit: The value of the threshold | |
:return: Current profit made | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_signature(): | |
ts = str(int(time.time())) | |
sig = str(ts + "." + public_key).encode() | |
sign = hmac.new(secret_key.encode(), sig, digestmod=sha256).hexdigest() | |
signature = "{0}.{1}.{2}".format(ts, public_key, sign) | |
return signature |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hmac | |
import time | |
from hashlib import sha256 | |
import subprocess | |
import requests | |
secret_key = '<your secret key here>' or input('Enter your secret key: ') | |
public_key = '<your public key here>' or input('Enter your public key: ') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
try: | |
import cPickle as pickle | |
except ImportError: | |
import pickle | |
try: | |
import hashlib | |
sha1 = hashlib.sha1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Always use objects when using binding in angular directives. | |
2. Everything is camel case, dashes don't exist in link function. | |
3. Add headers: headers: {'Content-Type': 'application/x-www-form-urlencoded'} when trying to submit form data with $http | |
4. $scope is not a model!!! | |