Bitcoin Forum
June 21, 2024, 11:50:44 AM *
News: Voting for pizza day contest
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Economy / Goods / Re: [WTS] Steam Games Below Market Value on: July 30, 2012, 09:48:24 PM
Why sell SR3 keys for the equivalent of $18 USD when you can get $30 USD for it if you sell it on ebay?
2  Bitcoin / Bitcoin Technical Support / Re: Req: Python MtGox auth example on: April 03, 2012, 08:07:57 PM
Here is a full API v0 example using the authentication code posted earlier, if anyone is interested...
It's only missing withdraw, btcAddress, and history_[CUR].

Code:
from urllib import urlencode
import urllib2
import time
from hashlib import sha512
from hmac import HMAC
import base64
import json
from pprint import pprint

class MtGox:
def __init__(self):
self.key = 'x'
self.secret = 'x'
self.auth = Authenticate(self.key,self.secret)

def getTrades(self, since):
path = "getTrades.php"
args = {'since': since}
return self.auth.run(path,args)

def getDepth(self):
path = "data/getDepth.php"
args = {'Currency': 'USD'}
return self.auth.run(path,args)

def getFunds(self):
path = "getFunds.php"
args = {}
return self.auth.run(path,args)

def buyBTC(self, amount, price):
path = "buyBTC.php"
args = {'amount': amount, 'price': price, 'Currency':'USD'}
return self.auth.run(path,args)

def sellBTC(self, amount, price):
path = "sellBTC.php"
args = {'amount': amount, 'price': price, 'Currency':'USD'}
return self.auth.run(path,args)

def getOrders(self):
path = "getOrders.php"
args = {}
return self.auth.run(path,args)

def cancelOrder(self, oid, type):
path = "cancelOrder.php"
args = {'oid': oid, 'type': type}
return self.auth.run(path,args)

def redeemCode(self, code):
path = "redeemCode.php"
args = {'code': code}
return self.auth.run(path,args)

def getInfo(self):
path = "info.php"
args = {}
return self.auth.run(path,args)

def getTicker(self):
path = "data/ticker.php"
args = {}
return self.auth.run(path,args)

def printDic(self, dic):
pprint(dic)
#MtGox End


def get_nonce():
    return int(time.time()*100000)

def sign_data(secret, data):
    return base64.b64encode(str(HMAC(secret, data, sha512).digest()))
     
class Authenticate:
    def __init__(self, auth_key, auth_secret):
        self.auth_key = auth_key
        self.auth_secret = base64.b64decode(auth_secret)
       
    def build_query(self, req={}):
        req["nonce"] = get_nonce()
        post_data = urlencode(req)
        headers = {}
        headers["User-Agent"] = "GoxApi"
        headers["Rest-Key"] = self.auth_key
        headers["Rest-Sign"] = sign_data(self.auth_secret, post_data)
        return (post_data, headers)
       
    def run(self, path, args):
        data, headers = self.build_query(args)
        req = urllib2.Request("https://mtgox.com/api/0/"+path, data, headers)
        res = urllib2.urlopen(req, data)
        return json.load(res)
#Authenticate End
3  Bitcoin / Bitcoin Discussion / Re: Shopping Online - Now EVERY Store Accepts Bitcoin on: August 05, 2011, 07:06:20 PM
Note the date of OP
4  Economy / Speculation / Re: BTC price will hit 5$ this week on: August 03, 2011, 02:38:46 PM
And the difficulty will keep increasing  Cheesy
5  Bitcoin / Bitcoin Discussion / Phone Call From Dwolla on: July 28, 2011, 07:30:28 PM
Someone from Dwolla just called me asking to verify my name and address.
Anyone else get a call? Think it has to do with the reversed transactions?
6  Bitcoin / Bitcoin Discussion / Re: TRADEHILL COMPROMISED - HACKER ATTACK IMMINENT on: June 20, 2011, 08:02:36 PM
Same post was made on reddit 10 minutes ago.

http://www.reddit.com/r/Bitcoin/comments/i4lab/tradehill_passworduser_accounts_hackedtime_to/
7  Bitcoin / Mining / Re: ATI 6970 Optimization on: June 20, 2011, 02:33:07 AM
Why is it that as soon as I go over 900 core clock, I drop like 70 Mh/s?
8  Other / Beginners & Help / Re: Bandwidth Usage of bitcoind on: June 17, 2011, 05:05:03 PM
Almost none
9  Other / Beginners & Help / Re: Want 0.10 Bitcoin Free? BitcoinBoom is Looking for ... on: June 17, 2011, 05:04:12 PM
1DMKDnq4MoefsJanX5YpxRtca1JWnpgJqU

http://twitter.com/#!/takkun88
10  Other / Beginners & Help / Re: BTC for Steak and Ramen on: June 17, 2011, 05:02:25 PM
Lol Buy it every day
11  Other / Beginners & Help / Re: I'm out on: June 17, 2011, 05:01:44 PM
Have fun
12  Other / Beginners & Help / Re: Please sell me BTC via paypal on: June 17, 2011, 05:00:54 PM
There are some sites setup for something like this.
I dont know if they are still up.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!