Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
Удаленная работа для IT-специалистов
function getAll($id) { global $token; $resultarray = array(); $url = getRedirect('https://forum.arizona-rp.com/search/member?user_id='.$id); preg_match_all('/https:\/\/forum.arizona-rp.com\/search\/(\d+)\//',$url,$searchid); $searchid = $searchid[1][0]; $resultarray = recursiveparse('https://forum.arizona-rp.com/search/'.$searchid.'/?page=',$resultarray,$searchid); return $resultarray; } function recursiveparse($url,$resultarray,$searchid) { $i = 1; do { echo $page = getPage($url . $i); $ik = $i + 1; preg_match_all('/<a href="\/profile-posts\/(\d+)\/">.*<\/a>/',$page,$foo); preg_match_all('/<a href="\/profile-posts\/comments\/(\d+)\/">.*<\/a>/',$page,$fok); preg_match_all('/<a href="\/threads\/\d+\/post-(\d+)">/',$page,$threads); $resultarray = array_merge($resultarray,$foo[1],$fok[1],$threads[1]); if(preg_match_all('/<a href="\/search\/(\d+)\/older\?before=(\d+)"/',$page)) { preg_match_all('/<a href="\/search\/(\d+)\/older\?before=(\d+)"/',$page,$pageurl); echo 'https://forum.arizona-rp.com/search/'.$pageurl[1][0].'/older?before='.$pageurl[2][0]; $resultarray = array_merge(recursiveparse('https://forum.arizona-rp.com/search/'.$pageurl[1][0].'/older?before='.$pageurl[2][0],$resultarray,$pageurl[1][0])); } $i++; } while (preg_match_all('/<a href="\/search\/(\d+)\/older\?before=(\d+)"/',$page) or strpos($page,'<a href="/search/'.$searchid.'/?page='.$ik.'">')); return $resultarray; }