public class EventArgs<T> :EventArgs {
public EventArgs(T value)
{
m_value = value;
}
private T m_value;
public T Value
{
get { return m_value; }
}
}
Monday, November 24, 2014
Sunday, November 23, 2014
Tuesday, November 4, 2014
Parsing google JSON suggestions in C# .NET (suggestqueries.google.com)
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;
}
{
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;
}
Subscribe to:
Posts (Atom)