twister-analytics-crawler/curl/torproject.php
2021-05-30 01:33:36 +03:00

33 lines
594 B
PHP

<?php
class CurlTorProject extends Curl {
public function getExitNodes() {
$this->prepare('torbulkexitlist', 'GET');
if ($response = $this->execute(false)) {
$list = explode("\n", $response);
if (count($list)) {
$sanitized = [];
foreach ($list as $ip) {
$ip = $this->sanitize($ip);
if ($ip) {
$sanitized[] = $ip;
}
}
return $sanitized;
}
}
return false;
}
}