XDL_NO.14株式インターフェースの呼び出し
12632 ワード
株式のインターフェースを呼び出す
公式インターフェースは誰でも使えるものではないです.じゃ何の鬼を呼び出しますか?サードパーティインターフェースは、呼び出しを提案しないで、テストの時に使うのが不便で、お金が必要だと思います. インターフェースです.(みんなが好きなもの、お金が要らないです.お金がいらないです.)オススメ:新浪、騰訊 インターフェース使用ドキュメント
新浪株式インターフェース
公式インターフェースは誰でも使えるものではないです.じゃ何の鬼を呼び出しますか?
新浪株式インターフェース
:
1. http/javascript
2. web-service
1.http/javascript
1.1Sina
( :601006) , , :
http://hq.sinajs.cn/list=sh601006
url , :
var hq_str_sh601006=" , 27.55, 27.25, 26.91, 27.55, 26.20, 26.91, 26.92,
22114263, 589824680, 4695, 26.91, 57590, 26.90, 14700, 26.89, 14300,
26.88, 15100, 26.87, 3100, 26.92, 8900, 26.93, 14230, 26.94, 25150, 26.95, 15220, 26.96, 2008-01-11, 15:05:32";
, , , 0 。
0:” ”, ;
1:”27.55″, ;
2:”27.25″, ;
3:”26.91″, ;
4:”27.55″, ;
5:”26.20″, ;
6:”26.91″, , “ ” ;
7:”26.92″, , “ ” ;
8:”22114263″, , , , ;
9:”589824680″, , “ ”, , “ ” , ;
10:”4695″,“ ” 4695 , 47 ;
11:”26.91″,“ ” ;
12:”57590″,“ ”
13:”26.90″,“ ”
14:”14700″,“ ”
15:”26.89″,“ ”
16:”14300″,“ ”
17:”26.88″,“ ”
18:”15100″,“ ”
19:”26.87″,“ ”
20:”3100″,“ ” 3100 , 31 ;
21:”26.92″,“ ”
(22, 23), (24, 25), (26,27), (28, 29) “ ” “ ”
30:”2008-01-11″, ;
31:”15:05:32″, ;
JavaScript :
var elements=hq_str_sh601006.split(",");
document.write("current price:"+elements[3]);
( :601006)
current price:14.20
, URL , ; (601006) (601001) , URL:
http://hq.sinajs.cn/list=sh601003,sh601001
, (000001):
http://hq.sinajs.cn/list=s_sh000001
:
var hq_str_s_sh000001=" ,3094.668,-128.073,-3.97,436653,5458126";
: , , , , ( ), ( );
:
http://hq.sinajs.cn/list=s_sz399001
K , http://image.sinajs.cn/…./…/*.gif URL , * , :
K :
http://image.sinajs.cn/newchart/daily/n/sh601006.gif
:
http://image.sinajs.cn/newchart/min/n/sh000001.gif
K :
http://image.sinajs.cn/newchart/daily/n/sh000001.gif
K :
http://image.sinajs.cn/newchart/weekly/n/sh000001.gif
K :
http://image.sinajs.cn/newchart/monthly/n/sh000001.gif
1.2 Baidu&Google
baidu, google , , google 601006 ,
:
sina , google sina 。 , google 1.1 。
Baidu baidu
http://stock.baidu.com/
1.3
sina,baidu , 。 ,
, , sina。
ASP :
=5 then
stockdata=gethttp("http://hq.sinajs.cn/list=sh"&code&"")
if not len(stockdata)=0 then stockdata=split(stockdata,chr(34))(1)
end if
if len(stockdata)=0 then
stockdata="0,0,0,0,0,0,0,0,0,0,0,0"
else
stockdatasplit=split(stockdata,",") stockdata=""&exstock.checkstr(stockdatasplit(0))&","&stockdatasplit(1)&","&stockdatasplit(2)&","&stockdatasplit(3)&","&stockdatasplit(4)&","&stockdatasplit(5)&","&formatdatetime(""&stockdatasplit(30)&" "&stockdatasplit(31)&"",0)&""
end if
‘0= ,1= ,2= ,3= ,4= ,5= ,6=
getstockdata=stockdata
end function
function getstockimg(code)
dim rndnum,addnum,checkcode,imgsource
if len(code)=5 then
getstockimg="http://image.sinajs.cn/newchart/daily/n/sh"&code&".gif"
end if
imgsource="http://finance.sina.com.cn"
case 3
getstockimg="http://hq.gazxfe.com/stockchart/realline.chart?"&code&"&1003&SZ 500 330"
imgsource="http://hq.gazxfe.com"
case 4
getstockimg="http://chartse.stockstar.com/chartserver?code="&code&""
imgsource="http://www.stockstar.com/"
end select
getstockimg=split(""&getstockimg&"||"&imgsource&"","||")
end function
function getastockimg()
dim rndnum,addnum,checkcode
dim getastockimgb,imgsource
addnum=6
randomize:rndnum=cint(rnd*addnum)
select case rndnum
case 0
getastockimg="http://202.109.106.1/gifchartse/gif/000001.gif"
getastockimgb="http://202.109.106.1/gifchartse/gif/399001.gif"
imgsource="http://www.stockstar.com/"
case 1
getastockimg="http://money.163.com/special/100.gif?C39"
getastockimgb="http://money.163.com/special/101.gif?HrS"
imgsource="http://www.163.com"
case 2
getastockimg="http://www.10jqka.com.cn/curve/realtime/index2.php?code=1a0001&w=180&h=140"
getastockimgb="http://www.10jqka.com.cn/curve/realtime/index2.php?code=399001&w=180&h=140"
imgsource="http://www.10jqka.com.cn"
case 3
getastockimg="http://chart.cnlist.com/stockchart/realline.chart?1a0001&1002&SZ 180 140"
getastockimgb="http://chart.cnlist.com/stockchart/realline.chart?399001&1002&SZ 180 140"
imgsource="http://chart.cnlist.com/"
case 4
getastockimg="http://image.sinajs.cn/newchart/small/ish000001.gif?1189176558328"
getastockimgb="http://image.sinajs.cn/newchart/small/isz399001.gif?1189176558328"
imgsource="http://www.sinajs.cn"
case 5
getastockimg="http://218.1.72.66/cgi/pic/sh/realtime/JA000001164143.png"
getastockimgb="http://218.1.72.66/cgi/pic/sz/realtime/JA399001164143.png"
imgsource="http://www.cnstock.com/"
case 6
getastockimg="http://222.73.29.85/img/000001.png"
getastockimgb="http://222.73.29.85/img/399001.png"
imgsource="http://www.eastmoney.com/"
end select
getastockimg=split(""&getastockimg&"||"&getastockimgb&"||"&imgsource&"","||")
end function
%>
2. web-service
2.1 CHINAstock web-service:
http://www.webxml.com.cn/WebServices/ChinaStockWebService.asmx
WEB ( 、 ), 。 GIF 、 / / K 、 ( 、 、 、 、 、 、 、 、 、 、 、 、 、 、 - 、 - )。 WEB :
2.1.1 getStockImageByCode
GET GIF
INput:theStockCode = , :sh000001
POST /WebServices/ChinaStockWebService.asmx HTTP/1.1
Host: www.webxml.com.cn
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: http://WebXml.com.cn/getStockImageByCode
string
Output:
2.1.2 getStockImageByteByCode
GIF
INput:theStockCode = , :sh000001
POST /WebServices/ChinaStockWebService.asmx HTTP/1.1Host: www.webxml.com.cnContent-Type: text/xml; charset=utf-8Content-Length: lengthSOAPAction: "http://WebXml.com.cn/getStockImageByteByCode" string
:
R0lGODlhIQIsAfcAAAAAAAwLBxkGBQ4ODhAQEBsSChUVFS4TDB8eGQkA9koPCDAAzy4mFVgAp2UYC0IqEUYuBVwiDEAsI1QnFX8AgDU1NUozFlgxD6cBWVY5FnIwEmQ4Gc0AMlhDHPEADlVJMEpKSm1IHOUBWpY3FZMyVY9IGXRWIEFmWGNYUmpdPXJgHQB8HK9EGGBgX4lXIACoAHhkMyt4m4VkJtstbv8A
2.1.3 getStockImage_kByCode
GIF / / K (545*300pixel/72dpi)
INPUT: theStockCode =
theType = K (D: [ ]、W: 、M: ),
POST /WebServices/ChinaStockWebService.asmx HTTP/1.1Host: www.webxml.com.cnContent-Type: text/xml; charset=utf-8Content-Length: lengthSOAPAction: "http://WebXml.com.cn/getStockImage_kByCode" string string
:
K :
2.1.4 getStockImage_kByteByCode
GIF / / K
Input:theStockCode = , :sh000001
POST /WebServices/ChinaStockWebService.asmx HTTP/1.1Host: www.webxml.com.cnContent-Type: text/xml; charset=utf-8Content-Length: lengthSOAPAction: "http://WebXml.com.cn/getStockImage_kByteByCode" string string HTTP/1.1 200 OKContent-Type: text/xml; charset=utf-8Content-Length: length base64Binary
:
K
R0lGODlhIQIsAfcAAAAAAAwLBxkGBQ4ODhAQEBsSChUVFS4TDB8eGQkA9koPCDAAzy4mFVgAp2UYC0IqEUYuBVwiDEAsI1QnFX8AgDU1NUozFlgxD6cBWVY5FnIwEmQ4Gc0AMlhDHPEADlVJMEpKSm1IHOUBWpY3FZMyVY9IGXRWIEFmWGNYUmpdPXJgHQB8HK9EGGBgX4lXIACoAHhkMyt4m4VkJtstbv8A
2.1.5 getStockInfoByCode
input:theStockCode =
POST /WebServices/ChinaStockWebService.asmx HTTP/1.1Host: www.webxml.com.cnContent-Type: text/xml; charset=utf-8Content-Length: lengthSOAPAction: "http://WebXml.com.cn/getStockInfoByCode" string
String(24), :String(0) 、String(1) 、String(2) 、String(3) ( )、String(4) ( )、String(5) ( )、String(6) ( )、String(7) ( )、String(8) ( )、String(9) (%)、String(10) ( )、String(11) ( )、String(12) ( )、String(13) ( )、String(14) (%)、String(15)-String(19) - ( )/ 、String(20)-String(24) - ( )/ 。
Web service concurrent DBWS , SOAP DBWS 。
http://quote.yahoo.com/d/quotes.csv?s=MSFT&f=slc1wop
"MSFT","4:00pm - 30.70",+1.04,"21.46 - 30.75",29.77,29.66
http://quote.yahoo.com/d/quotes.csv?s=000969.SZ&f=slc1wop
, 。
s=000969.sz sz , SS
:
sinajs :
:
:
:
:
:
:
:
sinajs !
:
var elements=hq_str_s_sh000001.split(","); document.write(elements[3]);document.write("%"); document.write(" "); document.write(elements[1]);
騰訊株式インターフェース , http/javascript , chrome HTTP , 。
, , :
[html] view plain copy
http://qt.gtimg.cn/q=sz000858
:
[html] view plain copy
v_sz000858="51~ ~000858~27.78~27.60~27.70~417909~190109~227800~27.78~492~27.77~332~27.76~202~27.75~334~27.74~291~27.79~305~27.80~570~27.81~269~27.82~448~27.83~127~15:00:13/27.78/4365/S/12124331/24602|14:56:55/27.80/14/S/38932/24395|14:56:52/27.81/116/B/322585/24392|14:56:49/27.80/131/S/364220/24385|14:56:46/27.81/5/B/13905/24381|14:56:43/27.80/31/B/86199/24375~20121221150355~0.18~0.65~28.11~27.55~27.80/413544/1151265041~417909~116339~1.10~10.14~~28.11~27.55~2.03~1054.39~1054.52~3.64~30.36~24.84~";
~ , 0 ,
[html] view plain copy
0:
1:
2:
3:
4:
5:
6: ( )
7:
8:
9:
10: ( )
11-18:
19:
20:
21-28:
29:
30:
31:
32: %
33:
34:
35: / ( )/
36: ( )
37: ( )
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
:
[html] view plain copy
http://qt.gtimg.cn/q=ff_sz000858
:
[html] view plain copy
v_ff_sz000858="sz000858~41773.67~48096.67~-6322.99~-5.53~10200.89~14351.02~-4150.13~-3.63~114422.25~53015.90~59770.57~ ~20121221";
~ , 0 , :
[html] view plain copy
0:
1:
2:
3:
4: /
5:
6:
7:
8: /
9: 1+2+5+6
10:
11:
12:
13:
:
[html] view plain copy
http://qt.gtimg.cn/q=s_pksz000858
:
[html] view plain copy
v_s_pksz000858="0.196~0.258~0.221~0.325";
~ , 0 , :
[html] view plain copy
0:
1:
2:
3:
:
[html] view plain copy
http://qt.gtimg.cn/q=s_sz000858
:
[html] view plain copy
v_s_sz000858="51~ ~000858~27.78~0.18~0.65~417909~116339~~1054.52";
~ , 0 , :
[html] view plain copy
0:
1:
2:
3:
4:
5: %
6: ( )
7: ( )
8:
9: