sina_stock_interface 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sina_stock_interface/version.rb +1 -1
- data/lib/sina_stock_interface.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 125206c3b6f87a6ecb995c28739a98fa6bb5f3f2
|
|
4
|
+
data.tar.gz: 292f189c5c0c85466b51b9a1c52109947ec7159d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 10dbbf271793f2700e3ca531c3ffbf676530e497c8677a6e2480fa6a934c16635a04fddbde61e71d39d31ac2d16c1f85fc1a80828dcbf605988f3ad623e4b08c
|
|
7
|
+
data.tar.gz: 93751439f4e0b17eb324de9ec1056a8cda3f938f679ef0dfe831cb33cfd0ae4755a15d3765fe6bcd7d188929901f1ef8a55c63a54116bed7ae9a63a2c361df03
|
data/lib/sina_stock_interface.rb
CHANGED
|
@@ -151,7 +151,7 @@ module SinaStockInterface
|
|
|
151
151
|
class Data
|
|
152
152
|
StockDataUrl = 'http://hq.sinajs.cn/list='
|
|
153
153
|
def self.format_data(request)
|
|
154
|
-
request.scan(/var hq_str_(\w*)="(
|
|
154
|
+
request.scan(/var hq_str_(\w*)="(.*)";/).collect{|x| x.join(",").split(",")}
|
|
155
155
|
end
|
|
156
156
|
def self.get_stock_data_by_id(stock_id)
|
|
157
157
|
url = "#{StockDataUrl}#{stock_id}"
|
|
@@ -170,7 +170,7 @@ module SinaStockInterface
|
|
|
170
170
|
SSEUrl = 'http://www.sse.com.cn/js/common/ssesuggestdata.js'
|
|
171
171
|
SZSEUrl = 'http://www.szse.cn/szseWeb/FrontController.szse?ACTIONID=8&CATALOGID=1110&TABKEY=tab1&ENCODE=1'
|
|
172
172
|
def self.get_sse_info
|
|
173
|
-
format = /val:"(\w*)",val2:"(
|
|
173
|
+
format = /val:"(\w*)",val2:"(.*)",val3:"(\D*\w*)"}/
|
|
174
174
|
request = open(SSEUrl).read.force_encoding('UTF-8')
|
|
175
175
|
request.scan(format)
|
|
176
176
|
end
|