Определение google page rank сайта программно - C#
Формулировка задачи:
Доброго времени суток!Получил заказ написать утилиту для определения Google pr.На просторах рунета нашел кое-какие примеры и накорябал это:
Тиц получает,а вот пр-не получается.Что тут нужно изменить или доработать?
using System;
using System.Text;
using System.IO;
using System.Net;
using System.Text;
namespace tic-pr
{
class Program
{
static void Main(string[] args)
{
string adress = Console.ReadLine();
string htmlcode = getHttpPage("http://www.pr-cy.com.ua/?who=" + adress);
Console.WriteLine(htmlcode);//выводим код странички
htmlcode = html.Remove(0, html.IndexOf("Яндекс тИЦ"));
htmlcode = html.Remove(0, html.IndexOf("<a rel=\"nofollow\" target=\"_blank\""));
htmlcode = html.Remove(0, html.IndexOf(">") + 1);
string tic = html.Remove(html.IndexOf("</a>"));
Console.WriteLine(tic);
Console.ReadKey();
}
static String getHttpPage(string url)
{
try
{
WebRequest req = WebRequest.Create(url);
WebResponse res = req.GetResponse();
using (StreamReader reader = new StreamReader(res.GetResponseStream(), Encoding.Default))
{
return reader.ReadToEnd();
}
}
catch (Exception ex) { return ex.Message; }
}
}
}Решение задачи: «Определение google page rank сайта программно»
textual
Листинг программы
Вызывать так: get_pr("www.cyberforum.ru") . "/10";