NameSilo

Code to count Yahoo backlinks please

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

vincenzo

VIP Member
Impact
14
Hi,
I have a script that pulls a count of total backlinks from some search engines; Google, MSN, Altavista, Yahoo

Problem is that they all give the correct results, apart from Yahoo which just returns a zero.

I am not a coder, but think the offending code may be the following:

PHP:
//yahoo
$url1="http://search.yahoo.com/search?p=site%3A$showdomain&sm=Yahoo%21+Search&fr=FP-tab-web-t&toggle=1&ei=UTF-8";
$ugs->seturl($url1);
$ugs->gather();
$content=$ugs->getcontent();
preg_match("/<div id=yschinfo>(.*)<a/isU",$content,$yahoo);
preg_match("/about <strong>(.*)<\/strong>/isU",$yahoo[0],$yahoo1);
$url2="http://search.yahoo.com/search?p=link%3Ahttp%3A%2F%2F$showdomain&sm=Yahoo%21+Search&fr=FP-tab-web-t&toggle=1&ei=UTF-8";
$ugs->seturl($url2);
$ugs->gather();
$content=$ugs->getcontent();
preg_match("/<div id=yschinfo>(.*)<a/isU",$content,$yahoo);
preg_match("/about <strong>(.*)<\/strong>/isU",$yahoo[0],$yahoo2);
$yahoo1[1]=trim($yahoo1[1])?trim($yahoo1[1]):0;
$yahoo2[1]=trim($yahoo2[1])?trim($yahoo2[1]):0;
echo "Yahoo Indexed  <a href=\"$url1\">".$yahoo1[1]."</a><br>Yahoo Backlinks  <a href=\"$url2\">".$yahoo2[1]."</a><br><br>";
$yahoo1[1]=str_replace(",","",$yahoo1[1]);
$yahoo2[1]=str_replace(",","",$yahoo2[1]);

And I think this is the part that actually displays the result, together with a link.

PHP:
  <td>Yahoo</td>
                                        <td><?php echo $yahoo2[1]; ?></td>
                                        <td><a href="http://search.yahoo.com/search?p=link%3Ahttp%3A//<?php echo $url; ?>&sm=Yahoo!+Search&fr=FP-tab-web-t&toggle=1&ei=UTF-8" target="_blank">Click Here </a></td>

Any help appreciated.

Many thanks,

- Vince
 
Last edited:
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Please send me an e-mail to [email protected]
use subject: yahoo code, and I will send you a yahoo parser, that will only return results,ok?

You will must to call this script via a GET query like

http://softgroups.com/yahoo.php?site=softgroups.com
http://softgroups.com/yahoo.php?site=softgroups2.com // return 0 :)
http://softgroups.com/yahoo.php?site=namepros.com



http://softgroups.com/yahoo.php <-------- won't work :)


If you nead any modifcations question , just ask me

Here is the code said:
<?
if(isset($_GET['site'])){
$site=trim($_GET['site']);

$tsite=str_replace('http://www.','',$site);
$tsite=str_replace('http://','',$tsite);
$tdomain=explode('/',$tsite);
$tkeyword=$site;
$domain=trim($tdomain[0]);

$fraier=0;
if(count($tdomain)>=2){
$flogic=strlen($tdomain[1]);
if($flogic>=2){$fraier=1;}
}


if($fraier==1){$yserver='http://search.yahoo.com/search?p=site%3A'.$domain.'+'.$tkeyword;}
if($fraier==0){$yserver='http://search.yahoo.com/search?p=site%3A'.$domain; }


$handler=fopen($yserver,'r');
$smart_data=fgets($handler,14*11);
for($i=1;$i<=250;$i++) {
$smart_data.=fgets($handler,14*11);
}
fclose($handler);
//echo $smart_data;

$tbuffer1=explode('Search Results</h1><p>1',$smart_data);

$logic=count($tbuffer1);
if($logic==1){
echo "\r\n0";

} else {

$tbuffer2=explode('</strong>',$tbuffer1[1]);
$tbuffer3=explode('about',$tbuffer2[0]);
$tbuffer4=explode('from',$tbuffer3[1]);
$rezultate=trim($tbuffer4[0]);
$rezultate=str_replace(' ','',$rezultate);
echo "\r\n$rezultate";

}


} else {


echo "

You must to call this script via :

www.website.com/script.php?site=domainame
";

}

?>
 
Last edited:
0
Close
Hi softgroups,
Appreciate your help, but the script I use displays multiple results from Google, Yahoo, MSN, Altavista etc...

So I'm unsure how to integrate your code.

Is there no way you can see how to fix the code I posted instead please?

Many thanks,

- Vince
 
0
Close
Hi,
Any other coders here able to help?

Thanks,

- Vince
 
0
Close
If anyone can help, they can have all my NP$40

- Vince
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back