Module: Juhe::FinaceStock

Extended by:
FinaceStock
Included in:
FinaceStock
Defined in:
lib/juhe/finace_stock.rb

Constant Summary collapse

URL =
'http://web.juhe.cn:8080/finance/stock'

Instance Method Summary collapse

Instance Method Details

#hk(key, gid) ⇒ Object

香港单独某一个股票 www.juhe.cn/docs/api/id/21/aid/62



19
20
21
22
# File 'lib/juhe/finace_stock.rb', line 19

def hk(key, gid)
  res = RestClient.get("#{URL}/hk", params: {key: key, num: gid})
  JSON.parse res.body
end

#hkall(key, options = {}) ⇒ Object

香港股票市场列表 www.juhe.cn/docs/api/id/21/aid/632



25
26
27
28
29
30
31
# File 'lib/juhe/finace_stock.rb', line 25

def hkall(key, options = {})
  options[:page] ||= 1
  options[:type] ||= 1
  options[:key] = key
  res = RestClient.get("#{URL}/hkall", params: options)
  JSON.parse res.body
end

#hs(key, gid) ⇒ Object

沪深单独某一个股票 www.juhe.cn/docs/api/id/21



13
14
15
16
# File 'lib/juhe/finace_stock.rb', line 13

def hs(key, gid)
  res = RestClient.get("#{URL}/hs", params: {key: key, gid: gid})
  JSON.parse res.body
end

#shall(key, options = {}) ⇒ Object

上海股票市场列表 www.juhe.cn/docs/api/id/21/aid/635



52
53
54
55
56
57
58
# File 'lib/juhe/finace_stock.rb', line 52

def shall(key, options = {})
  options[:page] ||= 1
  options[:type] ||= 1
  options[:key] = key
  res = RestClient.get("#{URL}/shall", params: options)
  JSON.parse res.body
end

#szall(key, options = {}) ⇒ Object

深圳股票市场列表 www.juhe.cn/docs/api/id/21/aid/634



43
44
45
46
47
48
49
# File 'lib/juhe/finace_stock.rb', line 43

def szall(key, options = {})
  options[:page] ||= 1
  options[:type] ||= 1
  options[:key] = key
  res = RestClient.get("#{URL}/szall", params: options)
  JSON.parse res.body
end

#usa(key, gid) ⇒ Object

美股单独某一个股票 www.juhe.cn/docs/api/id/21/aid/75



7
8
9
10
# File 'lib/juhe/finace_stock.rb', line 7

def usa(key, gid)
  res = RestClient.get("#{URL}/usa", params: {key: key, gid: gid})
  JSON.parse res.body
end

#usaall(key, options = {}) ⇒ Object

美国股票市场列表 www.juhe.cn/docs/api/id/21/aid/633



34
35
36
37
38
39
40
# File 'lib/juhe/finace_stock.rb', line 34

def usaall(key, options = {})
  options[:page] ||= 1
  options[:type] ||= 1
  options[:key] = key
  res = RestClient.get("#{URL}/usaall", params: options)
  JSON.parse res.body
end