I need a simple java script which checks if a page has still my link on it. (To check if the reciprocal link is still there). Can anyone help? Plz..its very Urgent..Plz Help me..
I don't know if it is possible in Javascript.. it would be much simpler in a server side language like PHP or ASP.
Hi everyone, I'm interested in this topic too... let's say I need a script that goes through a list of url's and check for a backlink to my site.. Anyone knows of a script that does that? I know it must be a server side script Thanks for any help
Here is a free script that does it.. you can use it or pick it apart for the good bits. http://www.phpjunkyard.com/php-link-manager.php
$recip = "http://www.example.com"; // this is the reciprocal url... that EXACTLY must match $filename="links1.txt"; //File with sites where your link is suppose to be 1 per line. $found = 0; $notfound = 0; function backlinkCheck($siteurl, $recip) { if ($arrText = file($siteurl)){ for ($i=0; $i<count($arrText); $i++) { $text = $text . $arrText[$i]; } if (eregi($recip, $text)) { return true; // set true if there is a backlink fclose ($fd); } else { return false; // set false if backlink is missing fclose ($fd); } } return false; } echo "<h2>Link Checker</h2>"; echo "<p> This will check if the text ".$recip ." is found on the webpage</p><hr>"; $file_contents=file("$filename"); for ( $i=0; $i < sizeof($file_contents); $i++) { $line = ($file_contents[$i]); $line = trim($line); $siteurl=$line; if (backlinkCheck($siteurl, $recip)) { echo "<p>Backlink was <b>FOUND</b> on: ".$siteurl."</p>\n\n"; $found++; } else { echo "<p>Backlink was <b>NOT FOUND</b> on: ".$siteurl."</p>\n\n"; $notfound++; } } echo "Total Found ".$found ."<br>"; echo "Total Not Found ".$notfound ."<br>"; echo "Total Links Checked ".($notfound+$found)."<br>"; PHP: Something like this works, might need a bit of tweaking.
Thanks a lot! I'll try the scripts and see the results... the php code needs the exact url I guess, otherwise it'll need to spider the whole site.
Lets see if i can help out,after all i got help here too. Its the minimum i can do. Lets see a list of urls..check for backlinks so lets say the urls are an array you can get it from a db or so ,but i make an array for now <?php $urls=array('www.this.com','www.that.com'); $tocheck='www.mysite.com'; function CheckforBL(&$urls,&$tocheck) { foreach ($urls as $url) { $matches=array(); $handle=@fopen($url,'r'); while(!feof($handle)) { $data=fgets($handle); if (is_array($data)){foreach($data as $ln) { if (stristr($tocheck,$ln)!==false)$matches[]=$url; } } else{ if (stristr($tocheck,$data)!==false)$matches[]=$url: } fclose($handles); } return $matches; } ?> PHP: Not sure if this going to work, as i just coded it now in the reply lol
Trying to find the tweaking... it gives me this error.... Parse error: parse error, unexpected T_STRING in C:\Program Files\Apache Group\Apache2\htdocs\blchecker\blcheck.php on line 7 thanks for the help
Well, the script seems to be working now but it crash after some time of execution.... what could it be wrong!? The code is: <?php $recip = 'http://www.domain.com'; // this is the reciprocal url... that EXACTLY must match $filename = 'links1.txt'; //File with sites where your link is suppose to be 1 per line $found = 0; $notfound = 0; function backlinkCheck($siteurl, $recip) { if ($arrText = file($siteurl)){ for ($i=0; $i<count($arrText); $i++) { $text = $text . $arrText[$i]; } if (eregi($recip, $text)) { fclose ($fd); } else { return false; // set false if cklinbak is missing fclose ($fd); } } return false; } echo '<h2>Link Checker</h2>'; echo '<p> This will check if the text '.$recip .' is found on the webpages</p><hr>'; $file_contents=file($filename); for ( $i=0; $i < sizeof($file_contents); $i++) { $line = ($file_contents[$i]); $line = trim($line); $siteurl=$line; if (backlinkCheck($siteurl, $recip)) { echo '<p>Backlink was <b>FOUND</b> on: '.$siteurl."</p>\n\n"; $found++; } else { echo '<p>Backlink was <b>NOT FOUND</b> on: '.$siteurl."</p>\n\n"; $notfound++; } } echo 'Total Found '.$found .'<br>'; echo 'Total Not Found '.$notfound .'<br>'; echo 'Total Links Checked '.($notfound+$found).'<br>'; echo 'Total Not Found '.$notfound .'<br>'; echo 'Total Links Checked '.($notfound+$found).'<br>'; ?> Code (markup): And the result I get is: Link Checker This will check if the text http://www.domain.com is found on the webpages Backlink was NOT FOUND on: http://www.vlib.org/ Backlink was NOT FOUND on: http://www.netcenter.com/ Backlink was NOT FOUND on: http://www.msn.com/ Backlink was NOT FOUND on: http://www.indiana.edu/ Backlink was NOT FOUND on: http://www.dmoz.org/ Backlink was NOT FOUND on: http://www.bbc.co.uk/ Backlink was NOT FOUND on: http://www.zeal.com/ Backlink was NOT FOUND on: http://www.yell.co.uk/ Backlink was NOT FOUND on: http://www.yahoo.com.au/ Backlink was NOT FOUND on: http://www.wisenut.com/ Backlink was NOT FOUND on: http://www.webcrawler.com/ Backlink was NOT FOUND on: http://www.voila.fr/ Backlink was NOT FOUND on: http://www.tripod.lycos.com/ Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Files\Apache Group\Apache2\htdocs\blcheck\blcheck.php on line 7 BTW if this post belongs to php section, would be great if a moderator moves it.
if your PHP is not running in safe mode you could try upping the max execution time by using set_time_limit(90000); http://ca.php.net/manual/en/function.set-time-limit.php might work, I have not tested.
The code is working now, I just modified the mac execution time in the php.ini to 0 (unlimited) (since I'm running locally). The problem now is that it checks only the exact url, I wonder if checking the whole site (to see if your url is there) would take much time to do it? I'm kind of beginner so I need some help if it's possible. Thanks in advance..
Does anyone know if there's a way to check a whole domain (like a spider) for your backlink? Because sometimes I don't know the exact page where my backlink is... thanks.
I know this thread has long grown cold, but I think I've got something which could help anyone else who comes across it. My site hosts a CGI script which checks for links between two pages. So you can call it with Javascript and get the results in an iframe: var src="http://www.sectorprime.com/cgi-bin/link_form_validation.pl" + "?sectorprimelink=" + encodeURI("<A PAGE WHICH LINKS TO www.sectorprime.com>") + "&fromurl=" + encodeURI("<THE PAGE THE LINK SHOULD BE ON>") + "&tourl=" + encodeURI("<THE PAGE THE LINK SHOULD BE TO>"); frames['linkValidationFrame'].location.href=src; Code (markup): By default, the page loaded in the iframe contains a simple message, such as "Reciprocal link exists". However, you can also pass parameters which cause the iframe contents to be redirected to one of your own pages: var src=<AS ABOVE> + "passurl=" + encodeURI("<MY PASS PAGE>"); frames['linkValidationFrame'].location.href=src; Code (markup): Because this is one of your own pages, you can now interact between the frames without being restricted by cross-site scripting safeguards. For instance your pass page could include: <body onload="parent.setReciprocalLinkOkay(true)"> Code (markup): which would fire the method in the original (parent) frame. So, going back to Ravi's original request: this is possible, if someone else is willing to host the CGI script. Anyone's script would do - if you want to use mine, full details of all the parameters are on http://www.sectorprime.com/link_form_validation.htm.