How to fetch PR from Google with .NET?
Is there a library/class for .NET (VB preferably) that allows to get the PR value of a site from Google?
Thank you!开发者_C百科
Google exposes a very simple API to get a site's PageRank value. All that it involves is an HTTP request, but with a little extra twist. Once you know how that works, it's trivial to implement the necessary code to retrieve it in C# or VB.NET.
Here are a few code samples available online that have already done the hard part for you:
- Request Google's Page-rank Programmatically on CodeProject
- Page Rank tool in VB.NET and C# by Aaron Reynolds
Most of them appear to be in C#, but that's no big deal. You can either compile the C# code into a new "Class Library" project (DLL), which you reference from your existing VB.NET solution, or you can spend a little quality time with the code and translate it to VB.NET. The languages are very similar, minus a few syntactical differences, so if you have the time, I highly recommend the second approach. Translating by hand requires you to go over every inch of the code manually and forces you to think about what it means and what it does. There's no better way to ensure that you understand what you're using. If you get stuck, consult one of the online translation tools, like the one provided by DeveloperFusion.
精彩评论