通过新浪股票行情接口,怎么判断当天除权除息的股票?

WBOY
Release: 2016-06-23 13:54:05
Original
1708 people have browsed it

我想制作一个功能,点下按钮,就可以把当天除权除息的股票列出来,我的网站股票行情是调用的新浪接口。
不知道谁有开发过这个功能的,或者有技术开发这个小功能的,本人不甚感激,也可有酬劳略表心意哦。


回复讨论(解决方案)

木有人会吗 ? 求帮助!!!

你接口要拿出来看下的

没有数据演示不好判断如何处理

$curl=&new Curl_HTTP_Client();				$html_data=$curl->fetch_url("http://hq.sinajs.cn/list=".$StockList,"",5);				$html_data=iconv("GB2312","UTF-8",$html_data);				$data='';				if($html_data)				{					preg_match_all("/str_(.+?)\";/is",$html_data,$data);					$messages=str_replace('="',",",$data[1]);				}				$list = '';				$i=0;				foreach($messages as $l)				{						$N=split(',',$l);					$N[0]=substr($N[0],2);					$cj = round($N[4]-$N[3],2);					$cjl = ceil($N[9]/100); //成交量(手)					$zdf = round(($N[4]-$N[3])*100/$N[4],2); //涨跌幅					$color = $cj>=0 ? '#FF0000' : '#008000';					$bgcolor = (($i+1)%2==0) ? '#F5F5F5' : '#ffffff';					if($N[4]==0) //停牌					{						$color = '#000000';						$N[4]= '--';						$cjl = '--';						$cj = '--';						$zdf = '--';						$N[7]='--';						$N[8]='--';						$N[2]='--';						$N[5]='--';						$N[6]='--';					}					$html .= '<tr align="center" bgcolor="'.$bgcolor.'" onMouseOver="this.style.background=\'#FDF0D7\';" onMouseOut="this.style.background=\''.$bgcolor.'\';">';           			$html .= '<td align="center"><input type="checkbox" id="check_id'.$FavIDList[$i].'" name="check_name" value="'.$N[0].'" style="cursor:hand"></td>';          			$html .= "<td align=\"center\"><a href=\"javascript:ShowKline('".$N[0]."')\">".$N[0]."</a></td>"; //代码          			$html .= "<td align=\"center\"><a href=\"javascript:ShowKline('".$N[0]."')\">".$N[1]."</a></td>"; //名称          			$html .= '<td style="color:'.$color.'">'.$N[4].'</td> '; //当前价          			$html .= '<td>'.$cjl.'</td> '; //成交量          			$html .= '<td style="color:'.$color.'">'.($cj>0 ? '+'.$cj : $cj).'</td> '; //涨跌          			$html .= '<td style="color:'.$color.'">'.($cj>0 ? '+' : '').$zdf.'</td> '; //涨跌幅          			$html .= '<td>'.$N[7].'</td>'; //买价          			$html .= '<td>'.$N[8].'</td>'; //卖价          			$html .= '<td>'.$N[2].'</td> '; //开盘价          			$html .= '<td style="color:#FF0000">'.$N[5].'</td> '; //最高价         			$html .= '<td style="color:#008000">'.$N[6].'</td> '; //最低价          			$html .= '<td style="color:#000000">'.$N[3].'</td> '; //昨收价          			$html .= '<td align="center">'.$N[32].'</td> '; //时间         			$html .= ' <td align="center"><input type="button" name="btn_order" class="button3" value="下单"';					if($IsOpen==0) 					{						$html.=' disabled';					}					else					{						$html.=' onClick="location.href=\'order.php?do=order&stockcode='.$N[0].'\';"';					}					$html.=' /></td> ';        			$html .= '</tr> ';					$i++;				}
Copy after login

其实如果用过新浪这个股票行情接口的一看就明白我说什么,不过我还是把这个贴出来吧。
我想制作一个功能,点下按钮,就可以把当天除权除息的股票列出来。

等不到答案、、、、、

点下按钮,就可以把当天除权除息的股票列出来,这意味着:

你要获得所有股票的信息,而不是某几个股票;
获得的股票信息包含除权除息信息信息项。

而新浪行情接口两个条件都不满足:
一次只能获取指定几个股票(StockList)的数据,频繁访问估会被拒绝
 数据没有除权除息信息,这个你从返回的数据就能看出来。

不知道你是不是要做股票数据分析,是的话靠这样获取数据是不行的,需要更专业的数据获取办法,专业的数据数据量A股一个交易就有好几百兆!

一个交易日就有好几百兆!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!