--- a/admin/partialdata/scrapesingle.php +++ b/admin/partialdata/scrapesingle.php @@ -1,1 +1,811 @@ - +hasAttributes()) + { + $attrs = $root->attributes; + + foreach ($attrs as $i => $attr) + $result[$attr->name] = $attr->value; + } + + $children = $root->childNodes; +if ($root->childNodes) { + if ($children->length == 1) + { + $child = $children->item(0); + + if ($child->nodeType == XML_TEXT_NODE) + { + $result['_value'] = $child->nodeValue; + + if (count($result) == 1) + return $result['_value']; + else + return $result; + } + } + + $group = array(); + + for($i = 0; $i < $children->length; $i++) + { + $child = $children->item($i); + + if (!isset($result[$child->nodeName])) + $result[$child->nodeName] = dom_to_array($child); + else + { + if (!isset($group[$child->nodeName])) + { + $tmp = $result[$child->nodeName]; + $result[$child->nodeName] = array($tmp); + $group[$child->nodeName] = 1; + } + + $result[$child->nodeName][] = dom_to_array($child); + } + } +} + + return $result; +} + +$site = "https://www.tenders.gov.au/"; +//$cn = phpQuery::newDocument(file_get_contents("https://www.tenders.gov.au/?event=public.advancedsearch.keyword&keyword=CN".$cnid)); +$searchResult = phpQuery::newDocument(' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CN IDCN1234 + + +
AgencyDepartment of Veterans Affairs
Publish Date 18-Aug-2006
CategoryComputer services
Contract Period 1-Aug-2006 to 31-Jul-2007
Contract Value (AUD) $156,200.00
Supplier NameWIZARD INFORMATION SERVICES PTY LTD
+

+ Last Updated: 18-Aug-2006 4:51 pm (ACT Local time) + + Full Details + +

+
'); +foreach(pq('a') as $a) { + if (strpos($a->getAttribute("href"),"public.cn.view") >0 ) echo $a->getAttribute("href"); + break; +} +$cn = phpQuery::newDocument(' + + + + + + + + + + + AusTender: Contract Notice View - CN1234 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + Home + + + + + + + + Advanced Search + +
+ + + +
+ +
+ + + +
+ + (email) + +
+ + + + + + + +
+ + + + + + + +

+ + » Forgotten password? + +
+ + » New user registration + +

+ + + +
+ +

View

+ + + + + + + +

Info & Links

+ + + + + + + +

Policies

+ + + + + + + +
+ + + +
+ + + + + + + + + +
+ + + + + + + + + +

Contract Notice View - CN1234

+ + + + + +
+ + + + + +
+ + + +
+ +

AusTender holds Contract and Standing Offer Notices for the 07/08 financial year forward. For information related to previous years, please contact the AusTender Help Desk.

Subcontractors:  For Commonwealth contracts that started on or after 1 December 2008, agencies are required to provide the names of any associated subcontractors on request.  Information on subcontractors can be sought directly from the relevant agency through the Agency Contact listed in each Contract Notice.

+ +
+ + + +
+ + + +
+ +

IMU Contract Programmer: IMU-ICT040 (GAPS ID: 1611946)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CN IDCN1234
AgencyDepartment of Veterans Affairs
Publish Date 18-Aug-2006
CategoryComputer services
Contract Period + + 1-Aug-2006 to 31-Jul-2007 + +
Contract Value (AUD) + + $156,200.00 + +
DescriptionIMU Contract Programmer: IMU-ICT040 (GAPS ID: 1611946)
Procurement MethodOpen
Confidentiality - Contract + + + +
Confidentiality - Outputs + + No + +
ConsultancyNo
+ + + +

Supplier Details

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name + + WIZARD INFORMATION SERVICES PTY LTD + +
Postal AddressGPO Box 2700
Town/CityCANBERRA CITY
Postcode2601
State/TerritoryACT
CountryAustralia
ABN + + 47 008 617 561 + +
+ + + + + + + +

Agency Details

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Contact Name/th> + + Monico, Raymond J
Contact Phone(02) 6289 6016
BranchInformation Management Unit
DivisionNational Office Compensation Division
Office Postcode2606
Agency Reference ID107460
+ + + + + + + + + + '); + +foreach(pq('tr') as $tr) { + $tra = dom_to_array($tr); + $tra['th'] = trim(str_replace("/th>","",$tra['th'])); +echo $tra['th']. " = " .trim(print_r($tra['td'],true))."
\n"; + +} + +?>