This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function get_web_page( $url,$curl_data ) | |
| { | |
| $options = array( | |
| CURLOPT_RETURNTRANSFER => true, // return web page | |
| CURLOPT_HEADER => false, // don't return headers | |
| CURLOPT_FOLLOWLOCATION => true, // follow redirects | |
| CURLOPT_ENCODING => "", // handle all encodings | |
| CURLOPT_USERAGENT => "spider", // who am i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class helper { | |
| //--------------------------------------------------------------------------- | |
| public function __construct() { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| include('simple_html_dom.php'); // DOM parsing library. | |
| $url = (isset($_GET['site'])) ? $_GET['site'] : 'http://www.yelp.com'; //just an example, clean this | |
| $dom = file_get_html($url); | |
| foreach ($dom->find('a') as $node) { | |
| // Replace href attribute value | |
| $node->href = 'http://YOURPROXYSERVER.COM?requestedurl='.urlencode($url.$node->href); | |
| } | |
| // Output modified DOM | |
| echo $dom->outertext; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function getinboundLinks($domain_name) { | |
| ini_set('user_agent', 'NameOfAgent (<a class="linkclass" href="http://localhost">http://localhost</a>)'); | |
| $url = $domain_name; | |
| $url_without_www=str_replace('http://','',$url); | |
| $url_without_www=str_replace('www.','',$url_without_www); | |
| $url_without_www= str_replace(strstr($url_without_www,'/'),'',$url_without_www); | |
| $url_without_www=trim($url_without_www); | |
| $input = @file_get_contents($url) or die('Could not access file: $url'); | |
| $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>"; |
NewerOlder