webgyrl 2 Posted April 2, 2004 Share Posted April 2, 2004 I was wondering if anyone out there knows of a service that counts the number of pages in a web site? I'm looking for something that would allow me to plug in the domain name and then it would count all pages and sub-directory pages and give me the total pages that make up the web site. Thanks, Nat Quote Link to post Share on other sites
tr4nc3 0 Posted April 2, 2004 Share Posted April 2, 2004 Put this php script in the root dir of your site and run it. It will return the total number of files. ><? function direcho($path){global $a;if($dir=opendir($path)){while(false!==($file=readdir($dir))){if(is_dir($path.$file)){if($file!='.'&&$file!='..'){direcho($path.$file);}}else{$a++;}}closedir($dir);}return $a;} echo direcho('./'); ?> Quote Link to post Share on other sites
tr4nc3 0 Posted April 2, 2004 Share Posted April 2, 2004 Ohh yeah you wanted just the pages and not all the files. Well this PHP script will give you the count of all the .html, .htm, and .php files in your site. ><? function direcho($path){ global $a; if($dir=opendir($path)){ while(false!==($file=readdir($dir))){ if(is_dir($path.$file)){ if($file!='.'&&$file!='..'){ direcho($path.$file);}}else{ if(strstr($file,".htm") || strstr($file,".php")){ $a++;} }}closedir($dir);} return $a;} echo direcho('./'); ?> Quote Link to post Share on other sites
webgyrl 2 Posted April 2, 2004 Author Share Posted April 2, 2004 Thanks for those PHP scripts! I'm actually looking to count the pages that are on other peoples' sites, not mine. I thought I ran into something like that a few years ago online. You would just plug in the URL and it would spit out the total number of pages that were included on that site. Thanks for the help. Nat Quote Link to post Share on other sites
DarqFlare 0 Posted April 2, 2004 Share Posted April 2, 2004 I'm not aware of anything that can do that... About the most you can do is find a tool that utilizes Google, but even Google wouldn't have all of the pages indexed. Quote Link to post Share on other sites
Deverill 0 Posted April 2, 2004 Share Posted April 2, 2004 Hey Nat, See if Xenu will do what you want. It's technically a link checker but it does some good stuff. For instance I got this from your site. It looks better in their report than it does pasted here: Statistics for managersCorrect internal URLs, by MIME type: text/html 17 URLs 529035 Bytes (516 KB) 10.83% image/gif 56 URLs 353424 Bytes (345 KB) 35.67% image/jpeg 54 URLs 160297 Bytes (156 KB) 34.39% audio/x-mpegurl 15 URLs 1111 Bytes (1 KB) 9.55% audio/x-pn-realaudio 8 URLs 526 Bytes (0 KB) 5.10% audio/mpeg 7 URLs 8160852 Bytes (7969 KB) 4.46% Total 157 URLs 9205245 Bytes (8989 KB) 100.00% All pages, by result type: ok 257 URLs 69.09% skip external 85 URLs 22.85% skip type 6 URLs 1.61% cancelled / timeout 17 URLs 4.57% no such host 5 URLs 1.34% connection aborted 1 URLs 0.27% timeout 1 URLs 0.27% Total 372 URLs 100.00% Quote Link to post Share on other sites
webgyrl 2 Posted April 3, 2004 Author Share Posted April 3, 2004 Jim, That's exactly the sort of thing I am looking for! Do you know where I can download a recent version of Xenu? Thanks a million! Nat Quote Link to post Share on other sites
webgyrl 2 Posted April 3, 2004 Author Share Posted April 3, 2004 S'ok I did a search and found a download site for it. Gonna check that out this evening. Nat Quote Link to post Share on other sites
hindixp 0 Posted April 3, 2004 Share Posted April 3, 2004 Thanks tr4nc3 for the helpfull script. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.