public string GetBackLinks(string url) { yahooKey = "YahooExample"; YahooAPI.YahooSearchService ya = new YahooAPI.YahooSearchService(); string backlinks =""; try { YahooAPI.InlinkDataResponse.ResultSet r = ya.InlinkData(yahooKey,url,1, 1); // find out if we are in these results backlinks = r.totalResultsAvailable; } catch (System.Web.Services.Protocols.SoapException ex) { Console.Write("Error al obtener los enlaces: {0}",ex.Message); } ya = null; return backlinks; }
public int GetPosition(string keyword, string url) { yahooKey = "YahooExample"; YahooAPI.YahooSearchService ya = new YahooAPI.YahooSearchService(); int position = -1; int i = 0; int maxposition = 100; try { for (int j=0;j<maxposition;j=j+10){ YahooAPI.WebSearchResponse.ResultSet resultSet = ya.WebSearch (yahooKey, keyword,"all", 10, 1, "any", true, true, "en"); foreach (YahooAPI.WebSearchResponse.ResultType result in resultSet.Result) { Console.WriteLine("URL: {0}", result.Url); if (result.Url.IndexOf(url) >=0 ) { position = j+i+1; Console.WriteLine("We are rocking at number " + position); break; } i++; } if (position > 0) break; } } catch (System.Web.Services.Protocols.SoapException ex) { Console.Write("Error al obtener la posicion: {0}",ex.Message); } // gs = null; return position; }