looking for reciprocal link checker in php

Discussion in 'PHP' started by zahidraf, Jun 1, 2010.

  1. #1
    I am looking for a php script whcih can check the reciprocal link exits or not

    Thanks
     
    zahidraf, Jun 1, 2010 IP
  2. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #2
    roopajyothi, Jun 1, 2010 IP
  3. abhijit

    abhijit Notable Member

    Messages:
    4,094
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    215
    #3
    <?php
    
        $mydomain = "www.yourdomain.com"; // Set this to your domain
       
        $list = file_get_contents("sites.txt");
        $urls = explode ("\n", $list);
    
        echo "<B>Checking back links to $mydomain....</B><P><FONT SIZE=-1>";
       
        foreach ($urls as $url) {
            if (strlen ($url)) {
                echo $url . "<B><FONT COLOR=";
                if (strpos (file_get_contents($url), $mydomain) != FALSE) {
                    echo "GREEN> Found";
                } else {
                    echo "RED> Missing";
                }
                echo "</FONT></B><BR>";
            }
        }
        echo "</FONT>";
    
    ?>
    PHP:
    Reads a file (in the same directory) named sites.txt which is a list of URLs to check (separated by a carriage return).
     
    abhijit, Jun 1, 2010 IP
  4. abhijit

    abhijit Notable Member

    Messages:
    4,094
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    215
    #4
    abhijit, Jun 1, 2010 IP
  5. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #5
    I am not going to fight with you
    Have a look here first
    http://forums.digitalpoint.com/showthread.php?t=1805923&p=14219009#post14219009

    http://forums.digitalpoint.com/showthread.php?t=1805923&p=14306354#post14306354

    I don't need to fight with you like a stupid since you won't accept your Mistake nor give any credits to the Author :)
     
    Last edited: Jun 1, 2010
    roopajyothi, Jun 1, 2010 IP
  6. abhijit

    abhijit Notable Member

    Messages:
    4,094
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    215
    #6

    Tell me what mistake i did tried to help a OP by providing him the code which i never claimed was mine.
    On the other hand you steal other codes add 2-3 new lines(which you didny) and say voila i coded some crap now lemme show it to all.
    And all you guys need some proof..yep we need it :) .
    [/QUOTE]
    And when someone finds about it, you add a post am not the orginal author.Were you sleeping for the past 2-3months when you posted it.
    She adds this:
    But I don't need to fight with you like a stupid since you won't accept your Mistake nor give any credits to the Author :) (taste the flavor of your medicine :p)
     
    Last edited by a moderator: Jun 1, 2010
    abhijit, Jun 1, 2010 IP
  7. abhijit

    abhijit Notable Member

    Messages:
    4,094
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    215
    #7
    You said only when someone pointed it out that you are not the original author.If you would have been honest you won't have changed the credits in first place.
    But I don't need to fight with you like a stupid since you won't accept your Mistake :p :D :)
     
    abhijit, Jun 1, 2010 IP
  8. zahidraf

    zahidraf Well-Known Member

    Messages:
    450
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #8
    hello mates dont fight :)


    the given script check only URL but I m looking for anchor and URL both at same time

    Thanks
     
    zahidraf, Jun 2, 2010 IP
  9. abhijit

    abhijit Notable Member

    Messages:
    4,094
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    215
    #9
    Roopajyothi will help you out. :)
     
    abhijit, Jun 2, 2010 IP
  10. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #10
    Yeah Possible but you need to include with the exact tag, class name etc

    Example have a look here

    http://simplepie.org/wiki/plugins/start#aggregators

    You can see that the First link Source in form of

    <a href="http://bloggerposter.com" class="urlextern" title="http://bloggerposter.com"  rel="nofollow"> 
    Code (markup):
    So the php codes goes like this for the Particular URL in the Particular Page


    
    
    <?php
    
        $mydomain = "<a href=\"http://bloggerposter.com\" class=\"urlextern\" title=\"http://bloggerposter.com\"  rel=\"nofollow\">Blogger Poster</a>"; // Set this to your domain
       
        $list = file_get_contents("sites.txt");
        $urls = explode ("\n", $list);
    
        echo "<B>Checking back links to $mydomain....</B><P><FONT SIZE=-1>";
       
        foreach ($urls as $url) {
            if (strlen ($url)) {
                echo $url . "<B><FONT COLOR=";
                if (strpos (file_get_contents($url), $mydomain) != FALSE) {
                    echo "GREEN> Found";
                } else {
                    echo "RED> Missing";
                }
                echo "</FONT></B><BR>";
            }
        }
        echo "</FONT>";
    
    ?>
    
    
    PHP:
    We can also do it more effective by use of switch, loops and preg match etc.,
    But i have no time for that now
     
    roopajyothi, Jun 2, 2010 IP