private static ArrayList GetSuggestions(string searchQuery)
{
string query = "http://suggestqueries.google.com/complete/search?output=firefox&hl=pl-PL&q=" + searchQuery.Replace(" ", "+");
var client = new WebClient();
var content = client.DownloadString(query);
Console.WriteLine(content);
MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(content));
var serializer = new JavaScriptSerializer();
ArrayList deserializedArrayList = serializer.Deserialize<ArrayList>(content);
var suggestions = deserializedArrayList[1] as ArrayList;
return suggestions;
}
No comments:
Post a Comment