Skip to content

Instantly share code, notes, and snippets.

@bateller
Created December 18, 2015 19:01
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save bateller/bba56788f2363246c4c6 to your computer and use it in GitHub Desktop.
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.dan.me.uk/tornodes');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Linux i586; rv:31.0) Gecko/20100101 Firefox/31.0');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$html = curl_exec($ch);
if(curl_errno($ch))
{
echo curl_error($ch);
}
curl_close($ch);
$start = strpos($html, '<div class="article box">');
$end = strpos($html, '<!-- start footer -->');
$len = $end - $start;
$output = substr($html, $start, $len);
echo $output;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment