pr00f Posted January 26, 2012 Report Posted January 26, 2012 (edited) Un mic script ce preia lista de proxy-uri de pe primele cinci pagini (sau oricâte, dar în primele cinci sunt mai fresh), în format ip:port de pe hidemyass.com.<?phpfor ($page = 1; $page <= 5; $page++) { // Numarul paginilor. $content = file_get_contents("http://hidemyass.com/proxy-list/".$page); // Url-ul cu pagina. $start1 = "<td><span>"; // Preluam ip ... $end1 = "</td> <td rel="; // ... pana aici. $start2 = '" alt="flag" /> '; // Preluam port ... $end2 = '</span></td>'; // ... pana aici. for ($i = 1; $i <= 50; $i++) { // 50 proxy-uri per pagina. $r = explode($start1, $content); if (isset($r[$i])){ $r = explode($end1, $r[$i]); echo str_replace("</span></td> <td>", ":", $r[0]) . "<br>"; // Scriem ip:port}}}?> Edited April 25, 2012 by pr00f Quote
CristianRoflmao Posted January 27, 2012 Report Posted January 27, 2012 Super ! Foarte folositor .Multumesc. Quote
alien Posted January 27, 2012 Report Posted January 27, 2012 Simplu si la obiect. Ca idee(nu prea stiu php) se pot folosi regex pentru determinarea de IP : PORT in $content, iar adresa sa fie transmisa prin parametru. Ex: /script.php?content=http://hidemyass.com/proxy-list&maxpage=5Regex pt IP$string = "255.255.255.255";if (preg_match('/^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:[.](?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$/',$string)) { echo "IP address is good.";} Quote