Home Artikel Web Development Script Management PHP Google Blogsearch URL Scraper
Free Domain and Free Hosting has been launched. Cheap Domain and Hosting are also available to signup. Very match for your business needs and for your other private necessities. Features started with 300 MB Space, VistaPanel/Cpanel, 7 MySQL Databases, 6 Sub Domains, 6 Addon Domains, FTP Account, POP email accounts, PhpMyAdmin, Web Mail, File Manager, Password protected Folders, Automatic Script Installer and lots of more. Learn More...



Close Panel

Shout Box

Latest Message: 1 day, 21 hours ago
View archive

Guests are shown between [].


PHP Google Blogsearch URL Scraper PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Bang Igan   
Thursday, 18 December 2008 21:07

Sometimes you just need a crapload of URL’s from Wordpress blogs. It’s nobodies business why you need them, if you need them, you need them.

Enter DaPimp’s Google Blogsearch URL scraper.

In a nutshell, this script grabs the fist 1,000 results of Wordpress blogs for a given keyword, and spits them out in a nice list for you.

**You’ll need PHP5, and a server with cURL enabled for this script to work**

Instructions for use:

  1. just copy and paste the code below (wordpress buggers up the quote marks in code, so you’ll probably need to go and replace them manually -justdownload the script, it’s much easier)
  2. Open the script in a text editor, and change the $keyword variable at the top to the keyword you want to search for
  3. Save the script and upload it to your server
  4. Navigate to the script in your browser, and wait, you’ll get your list

============ Start PHP Script ================

 

<?php
ob_start();

//put your site’s URL here, but leave off the http://www
$url = “kematian.biz”;

//put all the keywords you want to check here, make sure you leave the single quotes and commas intact for each keyword
$keywords = array(
‘google scraper’,
‘php script to get pagerank’,
‘Simple PHP Google Bot Cloaking Script’,
);

//Just tells us what URL we’re checking rankings for
echo “<h2> Google SERPS For ” .$url. “</h2>”;

//start to run through each of the keywords
foreach($keywords as $keyword) {

//set our counter at zero, so we can work out what the ranking of the page
$count = 0;

//make a URL that we can query Google with
$search = “http://www.google.com/search?q=” .urlencode($keyword). “&num=100″;

//now go get that page
$google = file_get_contents($search);

//funky regular expression stuff to find our URL in the results
$description= (’/<h3 class=r><a href=\”(.+?)\” class=l/’);
preg_match_all($description,$google,$match);

//start looping through each of the results on the page
foreach( $match[1] as $value){

//Add one to the counter after we check each of the results
$count = $count + 1;

//check each of the 100 results from google, to see if our URL is in it.
if(strstr($value, $url)) {

//if this particular result has our URL in it, print it to the page, along with the ranking ($count variable from above)
echo $keyword. ” - ” .$count. “<br>”;
ob_flush();
flush();
}

}
//Have a bit of a rest before we go check the next keyword, so we don’t get booted from the Goog’
sleep(rand(30,60));
}

?>




































































And there you have it!

Tomorrow, the same script, but to get Yahoo! results…..

Comments (0)add comment

Write comment

busy

Related news items:
Newer news items:
Older news items:

 

Banner