public function getProductID()
 {
     $str = parent::getProductID();
     if (!$str) {
         $sourceurl = parent::getUrl();
         $arr = parse_url($sourceurl);
         $this->_productID = $arr['host'] . '_' . $str;
     }
     return $this->_productID;
 }
Ejemplo n.º 2
0
 public function getProductID()
 {
     $str = parent::getProductID();
     $sourceurl = parent::getUrl();
     $data = parent::getPriceUrl();
     $arr = parse_url($sourceurl);
     $baseurl = $arr['host'];
     $p = '/esf.(\\w+).fang/';
     preg_match($p, $baseurl, $out);
     $s = isset($out[1]) ? $out[1] : "";
     $this->_productID = $s . '-' . $str;
     return $this->_productID;
 }
 public function getCategoryItemUrL()
 {
     $sourceurl = parent::getUrl();
     $data = parent::getCategoryItemUrL();
     $arr = parse_url($sourceurl);
     $baseurl = $arr['scheme'] . "://" . $arr['host'];
     $this->_category_item_url = array();
     foreach ($data as $k => $v) {
         $url = trim($v);
         $skuid = str_replace("/a/", "", $v);
         $this->_category_item_url[$k] = $baseurl . '/agent/Agentnew/AloneService.aspx?managername=' . $skuid;
     }
     return $this->_category_item_url;
 }
 public function getCategoryItemUrl()
 {
     $data = parent::getCategoryItemUrl();
     $sourceurl = parent::getUrl();
     $arr = parse_url($sourceurl);
     $baseurl = $arr['scheme'] . "://" . $arr['host'];
     foreach ($data as $k => $v) {
         if (strstr($v, 'javascript')) {
             $v = $sourceurl;
         }
         if (!strstr($v, "http")) {
             $this->_category_item_url[$k] = $baseurl . $v;
         } else {
             $this->_category_item_url[$k] = $v;
         }
     }
     $this->_category_item_url[] = $sourceurl;
     return $this->_category_item_url;
 }
 public function getBaseUrl()
 {
     $str = parent::getUrl();
     $this->_baseurl = parent::getBaseUrl() . '/agentshop/' . $this->getProductID() . '-1-n';
     return $this->_baseurl;
 }
Ejemplo n.º 6
0
 public function getPrice()
 {
     $data = parent::getPrice();
     $sourceurl = parent::getUrl();
     $arr = parse_url($sourceurl);
     $baseurl = $arr['scheme'] . "://" . $arr['host'];
     if (!$data) {
         $this->_price = array();
         $filter = '//li[@class="site-topsearch"][2]/a/@href||2';
         $tmp = $this->_getRegexpInfo($filter, $this->getContent());
         $sourceurl = parent::getUrl();
         foreach ($tmp as $k => $v) {
             if (strstr($v, 'javascript')) {
                 $v = $sourceurl;
             }
             if (!strstr($v, "http")) {
                 $this->_price[$k] = $baseurl . $v;
             } else {
                 $this->_price[$k] = $v;
             }
         }
     } else {
         foreach ($data as $k => $v) {
             if (strstr($v, 'javascript')) {
                 $v = $sourceurl;
             }
             if (!strstr($v, "http")) {
                 $this->_price[$k] = $baseurl . $v;
             } else {
                 $this->_price[$k] = $v;
             }
         }
     }
     return $this->_price;
 }
 public function getProductID()
 {
     $str = parent::getUrl();
     if ($str) {
         $tmp = parse_url($str);
         parse_str($tmp['query'], $parr);
         $this->_productID = $parr['hid'];
     }
     return $this->_productID;
 }