Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Oct 2006
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up need a function, will pay. (regex skills needed) easy!

    I believe this is a pretty simple function for those who know their regex.
    I'm willing to pay $30 to whoever can make me this.. Payment via paypal or epassporte.
    I'll try to describe it as good as I can.


    function analyseUrl( $checkurl, $against)

    parameters:
    string $url - a url to a website, a http site, on default port. Don't have to worry about https, ftp or other if it's on a weird port, or username passwords in the url.
    string $agains - a url which we will search through $checkurl to find

    returns:
    array $keywords - All keywords that the $checkurl contains that link to $against


    Function description:
    The function will grab all html at given $checkurl, preg match it or something to find all <a> tags where the href is $agains. I will have to work on <a> tags that have single or double quotes, as well as links that don't have quotes.
    (match all theese: href=$agains, href='$agains', href="agains")

    Then it will grab the keyword that are inside the links. (can skip if it's linking an image.) like this: <a href="$against">[keyword]</a>

    then return an array with all collected keywords.


    example analyseUrl("http://www.yahoo.com","http://www.google.com")

    $checkurl
    Code:
    <html>
    <head>
    <title>Test Page</title>
    </head>
    <body>
    <h1> This is a test page</a>
    <a href="http://www.google.com">Google</a> is a great <a href=http://google.com/>search engine</a> for finding all kinds of useful <a href="http://www.yahoo.com">code</a>. Other than that, <a href='http://www.google.com'>google</a> is crap 
    </body>
    </html>
    This would return the following:
    Code:
    Array(
             [0] => "Google"
             [1] => "search engine"
             [2] => "google"
           );
    I can be reached on icq: 209292096 or email nextri at gmail dot com

  • #2
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    Just to clarify,

    You want a function with two input parameters as follows:

    1) url to request
    2) url that must be present in the link

    Then have an out put of the text of the links which match the second parameter from the page based on the first parameter in an array form?

  • #3
    New Coder
    Join Date
    Oct 2006
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You are correct bcarl314.

    But i guess, the second parameter could also just be a domain.
    like google.com

    then it will only look for links that goes to
    http://www.google.com
    http://google.com
    http://www.google.com/
    http://google.com/

    and not links like http://www.google.com/?q=foo

    This is to check if a page is hardlinking another page, and with what keywords it links with. and only links that go to the homepage/front page.

    Hope this makes some sence.

    I allready got one PM from someone who says they can do this. I'm waiting for a response.

  • #4
    New Coder
    Join Date
    Oct 2006
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think I've gotten what I need now. Thx to Steve..


  •  

    Posting Permissions

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