[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Can anyone tell me what I need to do to fix this, because it

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 19
Thread images: 3

File: SHA.png (179KB, 600x600px) Image search: [Google]
SHA.png
179KB, 600x600px
Can anyone tell me what I need to do to fix this, because it keeps coming back as 'invalid sign':

api_key = "my key"
api_secret = "my secret"

nonce = int(round(time.time()))-1493420495

while nonce > 1:
params = {"method":"getInfo",
"nonce": nonce}
params = urllib.urlencode(params)

H = hmac.new(api_secret, digestmod=hashlib.sha512)
H.update(params)
sign = H.hexdigest()

headers = {"Content-type": "application/x-www-form-urlencoded",
"Key":api_key,
"Sign":sign}

conn = httplib.HTTPSConnection("btc-e.com")
conn.request("POST", "/tapi", params, headers)
response = conn.getresponse()

print response.status, response.reason
print json.load(response)
>>
>>60280181
oh this is easy you just made a syntax error

just give it a couple looks over OP and you'll spot it
>>
>>60281763
I appreciate the confidence, but I'm not a programmer; I've just sorta been piecing my code together from examples I've found online. I'm willing to put in the effort, but could you at least give me a hint?
>>
>>60280181
Use
requests

Also use ['code] tags so that indentation is preserved so that we can see what is in the loop and what isn't. (Or just use pastebin)
>>
>>60281844
>use requests
Help?

Also... How do I use code tags?
>>
>>60281834
i was just troll u
>>
>>60282049
Okay. Well, fuck...

I've searched online a few times and there seems to be a common thing where hashes in python will work 1-2% of the time (and therefore clearly isn't a coding error) but the rest of the time it just doesn't work. I don't know what to do.
>>
>>60281909
type "
" before and "
" after the code
>>
>>60281909
   Just put your code between 
>>
>>60282233
>>60282193
like this?
>>
4chan won't let me repost it the code with whitespace (conn error).

I bet this'll go through just find though.
>>
File: test.jpg (128KB, 693x727px) Image search: [Google]
test.jpg
128KB, 693x727px
>>60282588
>>
Convert sign to a string from an integer.
>>
" test "
>>
File: imreadytofuckingdienow.jpg (43KB, 576x521px) Image search: [Google]
imreadytofuckingdienow.jpg
43KB, 576x521px
>>60282733
>>
>>60282709
Would that just be
sign = int(H.hexdigest())
?
>>
>>60282758
https://www.google.ca/search?q=python+convert+int+to+string
>>
>>60282778
Okay, so...
sign = str(H.hexdigest())


or

api_secret = str("my secret")
?
>>
>>60282865
Neither seem to make a difference. Still returns

200 OK
{u'success': 0, u'error': u'invalid sign'}
Thread posts: 19
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.