示例#1
0
$dealpageArray[address_all] = $html->find('table tbody tr td', 0)->innertext;
$siteArray[] = $dealpageArray;
echo '<pre>';
print_r($siteArray);
echo '</pre>';
exit;
$switch = 0;
foreach ($html->find('div.image-wrapper a') as $e) {
    unset($dealpageArray);
    if ($switch) {
        $switch = 0;
        $dealpageArray[url] = 'http://homerun.com' . $e->href;
        $inHtml = file_get_html($dealpageArray[url]);
        $dealpageArray[title] = str_replace("HomeRun.com :: ", "", $inHtml->find('title', 0)->innertext);
        $dealpageArray[price] = numberOnly(str_replace("Buy Now \$", "", $inHtml->find('button', 0)->innertext));
        $dealpageArray[value] = stripAllNonNumerical($inHtml->find('td.val span', 0)->innertext);
        $dealpageArray[vendor_name] = $inHtml->find('div.spot div', 0)->innertext;
        $dealpageArray[address_all] = $inHtml->find('div.spot div', 1)->innertext;
        $dealpageArray[img_url] = $inHtml->find('img.deal', 0)->src;
        $geo = $Application->getGeoCoord($dealpageArray[address]);
        $dealpageArray[longitude] = $geo['lng'];
        $dealpageArray[latitude] = $geo['lat'];
        $dealpageArray[source_id] = "12";
        $dealpageArray[location_id] = "6";
        $siteArray[] = $dealpageArray;
    } else {
        $switch = 1;
    }
    //		$dealpageArray[expires] =	strtotime('midnight');
    //
}
示例#2
0
<?php

$dealpageArray[url] = 'http://www.zozi.com/los-angeles';
$html = file_get_html($dealpageArray[url]);
$dealpageArray[title] = $html->find('div.top_part h1', 0)->innertext;
$dealpageArray[img_url] = $html->find('div#loadarea img', 0)->src;
$dealpageArray[price] = stripAllNonNumerical($html->find('div.price', 0)->innertext);
$dealpageArray[value] = stripAllNonNumerical($html->find('div.price', 0)->innertext) + stripAllNonNumerical($html->find('div.savings', 0)->innertext);
$dealpageArray[expires] = strtotime($html->find('div#countdown_end_date', 0)->innertext);
//		$dealpageArray[vendor] =	 $html->find('a.google_map', 0)->href;
$dealpageArray[source_id] = "9";
$dealpageArray[region_id] = "6";
$siteArray[] = $dealpageArray;
$siteArray[] = $dealpageArray;