Author

Topic: [Bounty] 0.015 BTC for whoever can help with Python[Closed] (Read 629 times)

full member
Activity: 196
Merit: 100
Received! Thanks, Mooshire.
newbie
Activity: 4
Merit: 0
Works in 2.7 for me:
https://gist.github.com/anonymous/862695cafa58a7a1d581

Should work in 3.3:
https://gist.github.com/anonymous/245e8a507a502fd5b860

Guess I'm late though. Just in case -> 1AiKrzcbppKdD8T2vN27hf1UFZ25V8ZbQm
member
Activity: 103
Merit: 10
Code:
import urllib
import re

link = "https://api.bitcoinaverage.com/no-mtgox/ticker/USD"
f = urllib.urlopen(link)
myfile = f.read()
last = re.search("last\": (.+?),", myfile).group(1)
myFile = open('last.txt', 'w')
myFile.write(last)
myFile.close()

custom tailored Smiley 1C2NWeHxtaGyo9keSLwNMYXSsDBYwhMgaE

edit:

self-updating:

Code:
import urllib
import re
import time

while True:
        link = "https://api.bitcoinaverage.com/no-mtgox/ticker/USD"
        f = urllib.urlopen(link)
        myfile = f.read()
        last = re.search("last\": (.+?),", myfile).group(1)
        myFile = open('last.txt', 'w')
        myFile.write(last)
        myFile.close()
        print "updated: %s" % last
        time.sleep(30)
full member
Activity: 196
Merit: 100
https://gist.github.com/anonymous/7425079

See if it works on Python 3.3.2 (since I only have 2.7.4)
sr. member
Activity: 322
Merit: 250
I need to retrieve the last price from https://api.bitcoinaverage.com/no-mtgox/ticker/USD in a python script, then have it change the contents of a text file to the price. Couldn't do it myself.
Bonus 0.005 if it runs every 30 seconds to keep it updated. (It can stay running). (I would really prefer that it updates every 30 seconds)

EDIT: I will escrow if needed.

EDIT: Python 3.3.2

Someone in the JD chatroom claimed it. Thanks!
Jump to: