reciprocal link checker from ASP.NET - How do I implement one

Discussion in 'C#' started by SEO Jeff, Mar 2, 2005.

  1. #1
    Hi all. I cannot find on the web how I can develop a reciprocal link checker from ASP.NET.

    So far what I got developed is a Screen Scraper but I want it to verify the link I request is still on the site. I am looking into verifing a bulk of sites at once and just can't seem to get the scraper to what I want it to do.

    Any help will be greatly welcomed.
     
    SEO Jeff, Mar 2, 2005 IP
  2. Talker

    Talker Notable Member

    Messages:
    2,795
    Likes Received:
    108
    Best Answers:
    0
    Trophy Points:
    210
    #2
    Im looking for this too ..
    Can you forward me the scrrenscraper ? maybe its of my use.
     
    Talker, Apr 11, 2007 IP
  3. webcosmo

    webcosmo Notable Member

    Messages:
    5,840
    Likes Received:
    153
    Best Answers:
    2
    Trophy Points:
    255
    #3
    In ASP .NET C# you can do this:
    =========================
    String url="http://www.yahoo.com"; //example url
    WebClient client=new WebClient();
    Stream stream=client.OpenRead(url);
    String content=reader.ReadToEnd();
    String myUrl="http://www.webcosmo.com";
    bool linkExists=false;
    if(content.ToLower().IndexOf(myUrl)>=0)
    linkExists=true;

    ============================
    You have inlude this:
    using System.Net;


    best idea will be developing a windows form which will check bunch of sites in Thread with Thread.Sleep

    Hope it helps.
     
    webcosmo, Apr 11, 2007 IP
  4. Talker

    Talker Notable Member

    Messages:
    2,795
    Likes Received:
    108
    Best Answers:
    0
    Trophy Points:
    210
    #4
    Thanks for the code, ill see how it works and update this thread.
     
    Talker, Apr 12, 2007 IP
  5. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #5
    Run a regex once you get the Source... Also an easy way to use WebClient is using the shared method DownloadString.

    Instantiate your webclient, then dim str as string = webclientobj.downloadstring("http://www.smashingdir.com") and thats it :) then run a regex to traverse links, then iterate through that link collection for your link :)
     
    ccoonen, Apr 17, 2007 IP
  6. Talker

    Talker Notable Member

    Messages:
    2,795
    Likes Received:
    108
    Best Answers:
    0
    Trophy Points:
    210
    #6

    Do you have a sample page written in ASP.net (vb) ?
    I still aint able to get this done :(
     
    Talker, Apr 18, 2007 IP
  7. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #7
    I could write up one when I get back from Vacation Sunday night - if you remind me ;)
     
    ccoonen, Apr 18, 2007 IP
  8. Talker

    Talker Notable Member

    Messages:
    2,795
    Likes Received:
    108
    Best Answers:
    0
    Trophy Points:
    210
    #8
    Ok, ill wait.. thanks m8
     
    Talker, Apr 18, 2007 IP