|
|
@@ -8,6 +8,8 @@
|
|
|
|
|
|
class Input_sina_simple
|
|
|
{
|
|
|
+ private $globalUrl = "http://hq.sinajs.cn/list=";
|
|
|
+
|
|
|
static private function curl_get_data($url, $codeList){ //一次批量获取股票列表
|
|
|
if (empty($codeList)) {
|
|
|
return 0;
|
|
|
@@ -43,11 +45,11 @@ class Input_sina_simple
|
|
|
//获取指定条件的股票代码和名称列表
|
|
|
static private function getPartStockCodeAndNameList($exchange, $sector, $start, $end)
|
|
|
{
|
|
|
- $url = "http://hq.sinajs.cn/list=";
|
|
|
$data['exchange'] = $exchange;
|
|
|
$data['sector'] = $sector;
|
|
|
$codeList = array();
|
|
|
$codeIndex = 0;
|
|
|
+ $url = $this->globalUrl;
|
|
|
for($code = $start;$code < $end; $code++){
|
|
|
$codeStr = sprintf('%06s', $code);
|
|
|
$url .= 's_'.$exchange.$codeStr.',';
|