Results 1 to 7 of 7
  1. #1
    Join Date
    May 2007
    Posts
    139

    Unanswered: reciprocal links exchange maintenance script (search other Links Pages for my(or logi

    I am going to do a web-based "reciprocal links exchange maintenance script" (search other Links Pages for my(or login person) links correspondingly to assure links exist) with login/db well:
    how given a URL I search for words/URLs in it's contents(source) in JAVA and JSP?
    What language choose to implement this [tell me prefered 3 languages(web-based) for this] ?
    search contents SOURCE CODE and contents WHAT APPEAR ONLINE(Presentation) separatelly , or NON- only source ?

  2. #2
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    I've done this in PHP and it wasn't too difficult. Just grab the source of the web page and split it into separate links alongwith the text part of the link. Repeat for each url on your main page. If the page doesn't contain any good data then mark it as dead. If the page contains a link back to your page then mark it as a reciprocated etc. List out all the URLs and their status at the end.

  3. #3
    Join Date
    May 2007
    Posts
    139
    How I grab the source of the web page (url) in a text var ?
    what if not html/htm but php/jsp/cfm...?

  4. #4
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    Quote Originally Posted by lse123
    How I grab the source of the web page (url) in a text var ?
    The following grabs the source for a web page and splits it into urls and the text that goes with it. It's not perfect but I'm sure you can improve things if you want.
    Code:
    <?php
    
    $start_url = "http://www.bikesandkites.com/";
    
    # get the file contents
    $str = @file_get_contents( $start_url );
    
    # split it into parts where each contains a url
    $links = spliti( "<a ",$str );
    
    # for each part
    for( $i=0;$i<count($links);$i++ ) {
            # grab and clean up url
            $url = ereg_replace( "\>.*", "", $links[$i] );
            $url = eregi_replace( ".*href=", "", $url );
            $url = eregi_replace( "http:..", "", $url );
            $url = eregi_replace( " .*", "", $url );
    
            # grab and clean up txt part of link
            $txt = ereg_replace( "^[^>]*>", "", $links[$i] );
            $txt = ereg_replace( "[<].*", "", $txt );
    
            # print url and text
            echo "url=$url txt=$txt\n";
    };
    
    ?>

    Quote Originally Posted by lse123
    what if not html/htm but php/jsp/cfm...?
    Why should that matter?

  5. #5
    Join Date
    May 2007
    Posts
    139
    what if not html/htm but php/jsp/cfm...? server code like <?=...?> will not appear correct ? what will appear after grab ?

  6. #6
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    Quote Originally Posted by lse123 View Post
    what if not html/htm but php/jsp/cfm...? server code like <?=...?> will not appear correct ? what will appear after grab ?
    Why don't you try it and find out? if it's not correct then you could always try writing a little code yourself...

  7. #7
    Join Date
    Dec 2009
    Posts
    1

    java

    you have to make reciprocal link in your language which suites you better it can be java or c++

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •