@@ -0,0 +1,1654 @@
+import sys%0Aimport requests%0Aimport json%0Aimport urllib2%0Aimport time%0A%0Aif len(sys.argv) %3C 5:%0A    print %22Usage:  feed.py rpcuser rpcpass port %5C%22%5B'delegate','list'%5D%5C%22%22%0A    sys.exit(0)%0A%0Auser = sys.argv%5B1%5D%0Apassword = sys.argv%5B2%5D%0Aport = int(sys.argv%5B3%5D)%0Adelegates = eval(sys.argv%5B4%5D)%0A%0Aprint delegates%0A%0A%0Awhile True:%0A    url = 'https://www.bitstamp.net/api/ticker/'%0A    hdr = %7B'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',%0A           'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',%0A           'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',%0A           'Accept-Encoding': 'none',%0A           'Accept-Language': 'en-US,en;q=0.8',%0A           'Connection': 'keep-alive'%7D%0A%0A    req = urllib2.Request(url, headers=hdr)%0A%0A    bitstamp_data = json.load(urllib2.urlopen(req))%0A    usd_per_btc = float(bitstamp_data%5B%22last%22%5D)%0A%0A    url = 'http://data.bter.com/api/1/ticker/btsx_btc'%0A    req = urllib2.Request(url, headers=hdr)%0A    btsx_data = json.load(urllib2.urlopen(req))%0A    btc_per_btsx = float(btsx_data%5B%22last%22%5D)%0A%0A    usd_per_btsx = usd_per_btc * btc_per_btsx%0A    print usd_per_btsx%0A%0A%0A    url = %22http://%22 + user + %22:%22 + password + %22@localhost:%22 + str(port) + %22/rpc%22%0A%0A    for name in delegates:%0A        payload = %7B%0A            %22method%22: %22wallet_publish_price_feed%22,%0A            %22params%22: %5Bname, usd_per_btsx, %22USD%22%5D,%0A            %22jsonrpc%22: %222.0%22,%0A            %22id%22: 0,%0A        %7D%0A%0A        headers = %7B'content-type': 'application/json'%7D%0A        response = requests.post(url, data=json.dumps(payload), headers=headers)%0A        print response.json()%0A%0A%0A%0A    time.sleep(10)%0A

add price feed script