src/GetFrom.php
public function search($url, $detailedAd = false)
    {
        $searchData = new SearchResultCrawler(
            new Crawler((string) $this->client->get($url)->getBody()),
            $url
        );

        $url = new SearchResultUrlParser($url, $searchData->getNbPages());

        $ads = ($detailedAd) ? $searchData->getAds() : $searchData->getAdsId();

        $sumarize = [
            'total_ads'    => $searchData->getNbAds(),
            'total_page'   => $searchData->getNbPages(),
            'ads_per_page' => $searchData->getNbAdsPerPage(),
            'category'     => $searchData->getUrlParser()->getCategory(),
            'location'     => $searchData->getUrlParser()->getLocation(),
            'search_area'  => $searchData->getUrlParser()->getSearchArea(),
            'sort_by'      => $searchData->getUrlParser()->getSortType(),
            'type'         => $searchData->getUrlParser()->getType(),
            'ads'          => $ads,
        ];

        return array_merge($url->getNav(), $sumarize);
    }
public function search($url, $detailedAd = false)
    {
        $searchData = new SearchResultCrawler(
            new Crawler((string) $this->client->get($url)->getBody()),
            $url
        );

        $url = new SearchResultUrlParser($url, $searchData->getNbPages());

        $ads = ($detailedAd) ? $searchData->getAds() : $searchData->getAdsId();

        $sumarize = [
            'total_ads'    => $searchData->getNbAds(),
            'total_page'   => $searchData->getNbPages(),
            'ads_per_page' => $searchData->getNbAdsPerPage(),
            'category'     => $searchData->getUrlParser()->getCategory(),
            'location'     => $searchData->getUrlParser()->getLocation(),
            'search_area'  => $searchData->getUrlParser()->getSearchArea(),
            'sort_by'      => $searchData->getUrlParser()->getSortType(),
            'type'         => $searchData->getUrlParser()->getType(),
            'ads'          => $ads,
        ];

        return array_merge($url->getNav(), $sumarize);
    }
public function search ( $ url , $ detailedAd = false ) { $ searchData = new SearchResultCrawler ( new Crawler ( ( string ) $ this -> client -> get ( $ url ) -> getBody ( ) ) , $ url ) ; $ url = new SearchResultUrlParser ( $ url , $ searchData -> getNbPages ( ) ) ; $ ads = ( $ detailedAd ) ? $ searchData -> getAds ( ) : $ searchData -> getAdsId ( ) ; $ sumarize = [ 'total_ads' => $ searchData -> getNbAds ( ) , 'total_page' => $ searchData -> getNbPages ( ) , 'ads_per_page' => $ searchData -> getNbAdsPerPage ( ) , 'category' => $ searchData -> getUrlParser ( ) -> getCategory ( ) , 'location' => $ searchData -> getUrlParser ( ) -> getLocation ( ) , 'search_area' => $ searchData -> getUrlParser ( ) -> getSearchArea ( ) , 'sort_by' => $ searchData -> getUrlParser ( ) -> getSortType ( ) , 'type' => $ searchData -> getUrlParser ( ) -> getType ( ) , 'ads' => $ ads , ] ; return array_merge ( $ url -> getNav ( ) , $ sumarize ) ; }
retrieve the search result data from the given url

@param $url
@param bool $detailedAd

@return array
retrieve the search result data from the given url