| 1 | <?php |
||
| 11 | class SearchResultCrawler extends CrawlerAbstract |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @param $url |
||
| 15 | * @return SearchResultUrlParser |
||
| 16 | */ |
||
| 17 | 12 | protected function setUrlParser($url) |
|
| 21 | |||
| 22 | /** |
||
| 23 | * Return the total number of ads of the search |
||
| 24 | * |
||
| 25 | * @return int |
||
| 26 | */ |
||
| 27 | 6 | public function getNbAds() |
|
| 40 | |||
| 41 | /** |
||
| 42 | * Return the number of ads per page. |
||
| 43 | * |
||
| 44 | * Could be dynamically guessed in future, if Leboncoin change it frequently |
||
| 45 | * Or if they add the ability for user to change it on result pages. |
||
| 46 | * |
||
| 47 | * |
||
| 48 | * @return int |
||
| 49 | */ |
||
| 50 | 6 | public function getNbAdsPerPage() |
|
| 54 | |||
| 55 | /** |
||
| 56 | * Return the number of page |
||
| 57 | * |
||
| 58 | * @return int |
||
| 59 | */ |
||
| 60 | 6 | public function getNbPages() |
|
| 64 | |||
| 65 | /** |
||
| 66 | * Get an array containing the ads of the current result page |
||
| 67 | * |
||
| 68 | * @return array |
||
| 69 | */ |
||
| 70 | 8 | public function getAds() |
|
| 86 | |||
| 87 | /** |
||
| 88 | * Return the Ads's ID only |
||
| 89 | * |
||
| 90 | * @return array |
||
| 91 | */ |
||
| 92 | 4 | public function getAdsId() |
|
| 96 | } |
||
| 97 |