Skip to Main Content
SEO Warrior
book

SEO Warrior

by John I Jerkovic
November 2009
Beginner content levelBeginner
496 pages
13h 46m
English
O'Reilly Media, Inc.
Content preview from SEO Warrior

Appendix A. Script Listings

Chapter 2

Please note that some of these scripts are used to query search engines. Take extra caution before using these scripts in particular.

spiderviewer.php

<html> <head> <title>Search Engine Web Page Viewer</title> </head> <body> <form name=mainform action="" method="get"> <table border="0" width="100%" align=center> <tr> <td>Enter URL: <br> <input type="text" name="url" size="20"></td> </tr> <tr> <td> <input type="submit" value="Click to See Search Engine View" name="submit"> </td> </tr> </table> </form> <hr> <?php $myurl = $_GET['url']; if (isset($myurl)) { print spiderViewer($myurl); } ?> </body> </html> <?php function spiderViewer($url) { $finalHTML=''; if($url) { $originalHTML=get_content($url); if($originalHTML) { $finalHTML.='<table border="0" align="center" width="75%">'; $finalHTML.='<tr><td align="center" valign="top">'; $finalHTML.='<b>Search Engine View for URL:' . $url . '</b></tr>'; $finalHTML.='<tr><td align="left" valign="top">'; $originalHTML=preg_replace('/<script.*?>.*?<\/script.*?>/sim' ,'', $originalHTML); $originalHTML=preg_replace('/<object.*?>.*?<\/object.*?>/sim' ,'', $originalHTML); $originalHTML=preg_replace('/<applet.*?>.*?<\/applet.*?>/sim' ,'', $originalHTML); $originalHTML=preg_replace('/<style.*?>.*?<\/style.*?>/sim' ,'', $originalHTML); $originalHTML=preg_replace('/<.*?>/sim','',$originalHTML); $originalHTML=preg_replace('/&[#]{0,1}.[^ ]*;/sim',' ' ,$originalHTML); $stopWordsArray=explode("<br />", file_get_contents('stopwords.txt')); ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The SEO Battlefield

The SEO Battlefield

Anne Ahola Ward

Publisher Resources

ISBN: 9780596804749Errata Page