Commit c8781f83 authored by wuxiaoli's avatar wuxiaoli

修复新浪获取实时信息

parent a5d8bd78
......@@ -447,12 +447,16 @@ if (!function_exists('getEndDay')) {
if (!function_exists('sina_market')) {
function sina_market($code)
{
$headers = array(
'referer: http://finance.sina.com.cn',
);
$d = fenxi($code);
$randm = time() . mt_rand(100, 999);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://hq.sinajs.cn/rn=' . $randm . '&list=' . $d . ',' . $d . '_i');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$output = curl_exec($ch);
curl_close($ch);
$pos = strpos($output, '=') + 2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment