Permalink
Browse files

future update

  • Loading branch information...
1 parent 76465be commit 973215b3d086128104fd1e40625b1f301c2b03f7 @jimmysoa jimmysoa committed Oct 17, 2016
Showing with 2 additions and 6 deletions.
  1. +1 −1 setup.py
  2. +1 −5 tushare/futures/intlfutures.py
View
@@ -82,6 +82,6 @@ def read(fname):
'Programming Language :: Python :: 3.4',
'License :: OSI Approved :: BSD License'],
packages=['tushare','tushare.stock', 'tushare.data', 'tushare.util', 'tushare.datayes',
- 'tushare.internet', 'tushare.fund', 'tushare.trader'],
+ 'tushare.internet', 'tushare.fund', 'tushare.trader', 'tushare.futures'],
package_data={'': ['*.csv']},
)
@@ -24,17 +24,13 @@ def get_intlfuture(symbols=None):
df = _get_data(ct.INTL_FUTURE_URL%(ct.P_TYPE['http'], ct.DOMAINS['EM'],
ct.PAGES['INTL_FUT'], symbols,
_random(17)))
- print(df)
+ return df
def _get_data(url):
try:
request = Request(url)
data_str = urlopen(request, timeout=10).read()
-# data_str = data_str.decode('GBK')
data_str = data_str.split('=')[1]
-# data_str = """
-# {futures:["CONX0,CONX,美原油11,50.32,50.23,49.80,50.58,49.72,0,137713,0.00,0,0,50.32,0.00,0,181562,-0.52,-1.03%,0.00,831,137713,0,-1,1,0.00,0.00,2016-10-17 21:38:49,0","GLNZ0,GLNZ,美黄金12,1251.7,1252.6,1256.9,1258.0,1251.1,0,67082,0.0,0,0,1251.7,0.0,0,373385,5.2,0.42%,0.0,62,67082,0,-1,0,0.0,0.0,2016-10-17 21:38:41,0"]}
-# """
data_str = data_str.replace('futures', '"futures"')
if six.PY3:
data_str = data_str.decode('utf-8')

0 comments on commit 973215b

Please sign in to comment.