| Conditions | 7 |
| Paths | 13 |
| Total Lines | 48 |
| Code Lines | 28 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function run() |
||
| 16 | { |
||
| 17 | $exit = false; |
||
| 18 | $count = 0; |
||
| 19 | $numPaginator = 0; |
||
| 20 | $countProxyVirgin = rand(0, count($this->listOfVirginProxies) - 1); |
||
| 21 | $resultFinal = array(); |
||
| 22 | |||
| 23 | while ($exit == false) { |
||
|
|
|||
| 24 | if ($count != 0) { |
||
| 25 | $numPaginator = (100 * $count) + 1; |
||
| 26 | } |
||
| 27 | |||
| 28 | $urlOfSearch = 'https://search.yahoo.com/search?p='.urlencode($this->commandData['dork']).'&fr=yfp-t-707&pz=100&b='.$numPaginator; |
||
| 29 | |||
| 30 | $this->output('Page '.$count."\n"); |
||
| 31 | |||
| 32 | if ($this->commandData['virginProxies']) { |
||
| 33 | $body = Utils::getBodyByVirginProxies($urlOfSearch, $this->listOfVirginProxies[$countProxyVirgin], $this->proxy); |
||
| 34 | |||
| 35 | $arrLinks = Utils::getLinks($body); |
||
| 36 | |||
| 37 | if ($countProxyVirgin == count($this->listOfVirginProxies) - 1) { |
||
| 38 | $countProxyVirgin = 0; |
||
| 39 | } else { |
||
| 40 | ++$countProxyVirgin; |
||
| 41 | } |
||
| 42 | } else { |
||
| 43 | $body = Utils::getBody($urlOfSearch, $this->proxy); |
||
| 44 | |||
| 45 | $arrLinks = Utils::getLinks($body); |
||
| 46 | } |
||
| 47 | |||
| 48 | $this->output("\n".$urlOfSearch."\n"); |
||
| 49 | |||
| 50 | $results = Utils::sanitazeLinks($arrLinks); |
||
| 51 | |||
| 52 | if ((count($results) == 0 and $body != 'repeat')) { |
||
| 53 | $exit = true; |
||
| 54 | } |
||
| 55 | |||
| 56 | $resultFinal = array_merge($resultFinal, $results); |
||
| 57 | |||
| 58 | ++$count; |
||
| 59 | } |
||
| 60 | |||
| 61 | return $resultFinal; |
||
| 62 | } |
||
| 63 | } |
||
| 64 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.