tags:

views:

48

answers:

1

How would I go about creating a Backlink Checker in C#?

+1  A: 

First you'd have to expose the backlink(s) on the site somehow. Wordpress-based blogs may already do this, you'd have to find the xml feed or parse it out of the comments.

First place to start is WebClient. It'll allow you to download the contents of a page rather quickly, from here you can search the DOM for the appropriate links.

In your case you'd want to:

  1. Identify all backlinks for a given blog post, & store the permalink to the blog post somewhere.
  2. Visit all backlinks and save thier html dom
  3. Parse the html dom and verify that each one contains a link that somehow points back to your original blog post permalink.

This would probably require one web request to YOUR SITE to obtain the list of backlinks. Then one successive blog post to each backlink provided. You may have to handle redirects, I don't remember if WebClient does this automagically.

Aren
Both `WebClient` and `HttpWebRequest` handle redirects
Chris T
@Chris T: Thx, I wasn't sure.
Aren
lucifer