"; $selcodeval = ""; $his = ""; $asxarr = array("Automobile & Components","Banks","Capital Goods","Classification Pending","Commercial & Professional Services","Consumer Durables & Apparel","Consumer Services","Diversified Financials","Energy","Food & Staples Retailing","Food Beverage & Tobacco","GICS Sector Code Not Applicable","Health Care Equipment & Services","Household & Personal Products","Insurance","Materials","Media","Pharmaceuticals","Real Estate","Retailing","Semiconductors & Semiconductor Equipment","Software & Services","Technology Hardware & Equipment","Telecommunication Services","Transportation","Utilities","AKQ","FOX","GID","HCS","RVA"); date_default_timezone_set('UTC'); $timeis = date('h:i:s'); $dateis = date('Y-m-d'); $vstimeis = $timeis; $vsdateis = $dateis; if (file_exists("Banks_" . $dateis . ".dat") && !isset($_GET['refresh'])) { $fl=fopen("lastGo.is", "r"); $vstimeis = fread($fl, 100); fclose($fl); } else { $fl=fopen("lastGo.is", "w"); fwrite($fl, $timeis); fclose($fl); } foreach ($asxarr as &$value) { if (file_exists(str_replace("_", "%20", $value) . "_" . $dateis . ".dat") && !isset($_GET['refresh'])) { if ($his == "") { $his = "ASX Listing Information ... collected on (" . $vsdateis . "-" . str_replace("-", ":", $vstimeis) . " GMT) ... via http://gomashup.com/cms/Australian Securities Exchange ASX Code JSON Data Feeds ... thanks."; echo $his; } $pageContent = ""; $fl=fopen(str_replace("_", "%20", $value) . "_" . $dateis . ".dat", "r"); while (($buffer = fgets($fl, 500000)) !== false) { $pageContent .= $buffer; } fclose($fl); } else { if ($his == "") { $his = "<html><head><title>ASX Listing Information ... reading now (" . $dateis . "-" . $timeis . " GMT) ... via http://gomashup.com/cms/Australian Securities Exchange ASX Code JSON Data Feeds ... thanks."; echo $his; } $pageContent = file_get_contents('http://gomashup.com/json.php?fds=finance/aus/industry-group/' . str_replace(" ", "%20", $value) . '&jsoncallback=?',0,null,null); $fl=fopen(str_replace("_", "%20", $value) . "_" . $dateis . ".dat", "w"); fwrite($fl, $pageContent); fclose($fl); } $json = substr(str_replace('industry-group','industrygroup', str_replace('company-name','companyname', str_replace(']}',']', str_replace('{x[','[', str_replace('"result":','', str_replace(")", "", str_replace("?(","",$pageContent))))))),1); $json_output = json_decode($json); //,true); $an .= $value; for ($i=0; $i<sizeof($json_output); $i++) { //echo $i; $selcodeval .= "\n<option value='"; $selcodeval .= $json_output[$i]->code; $selcodeval .= "'>"; $selcodeval .= $json_output[$i]->code; $selcodeval .= "</option>"; $selindustrygroupval .= "\n<option value='"; $selindustrygroupval .= $json_output[$i]->industrygroup; $selindustrygroupval .= "'>"; $selindustrygroupval .= $json_output[$i]->industrygroup; $selindustrygroupval .= "</option>"; $selcompanyval .= "\n<option value='"; $selcompanyval .= $json_output[$i]->companyname; $selcompanyval .= "'>"; $selcompanyval .= $json_output[$i]->companyname; $selcompanyval .= "</option>"; } } $selcodeval .= "\n</select>"; $selcompanyval .= "\n</select>"; $selindustrygroupval .= "\n</select>"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n


  "; $ls = ''; if ($lis != "en" && $lis != "") { echo str_replace('value="' . $lis . '"', 'value="' . $lis . '" selected="selected"', $ls); } else { echo $ls; } echo "

"; if ($vstimeis != $timeis && file_exists("lastGo.is")) { if ($vstimeis == "") { $fl=fopen("lastGo.is", "r"); $vstimeis = fread($fl, 100); fclose($fl); } echo "  Click if " . $dateis . "-" . str_replace("-", ":", $vstimeis) . " vs " . $timeis . " GMT is too stale for you"; } echo "

\n" . $selcompanyval . "  " . $selindustrygroupval . "  " . $selcodeval . ""; ?>