Вы собираетесь использовать Facebook.dll, вы можете скачать его с помощью диспетчера пакетов в Visual Studio, если вы используете C #, например
Пакет NuGet здесь ..
и код может выглядеть следующим образом
public List<string> Facebook(string query)
{
// Facebook.FacebookAPI api = new FacebookAPI();
List<string> list = new List<string>();
string[] arr = new string[5];
string result = null;
FacebookAPI api = new FacebookAPI(token);
// запрос по вашим критериям поиска
JSONObject q = api.Get("https://graph.facebook.com/search?q="+query+"&type=post");
foreach (JSONObject item in q.Dictionary["data"].Array)
{
if (item.IsDictionary)
{
foreach (KeyValuePair<String,JSONObject> jso in item.Dictionary)
{
if (jso.Key == "message"/* || jso.Key == "name" || jso.Key == "description" || jso.Key == "link"*/)
{
for (int i = 0; i < 5; i++)
{
arr[i] = jso.Value.String;
}
list.Add (jso.Value.String);
}
else if (jso.Key == "likes")
{
foreach (JSONObject like in jso.Value.Dictionary["data"].Array)
{
foreach (KeyValuePair<String, JSONObject> lik in like.Dictionary)
{
if (lik.Key == "name")
{
result += lik.Value.String;
}
else if (lik.Key == "id")
{
result += lik.Value.String;
}
}
}
foreach (KeyValuePair<String, JSONObject> count in jso.Value.Dictionary)
{
if (count.Key == "count")
{
result += count.Value.String;
}
}
}
else if (jso.Key == "from")
{
foreach (KeyValuePair<String, JSONObject> froms in jso.Value.Dictionary)
{
if (froms.Key == "name")
{
result += froms.Value.String;
}
}
}
}
}
/*
else if (item.IsArray)
{
foreach (JSONObject j in item.Dictionary["data"].Array)
{
if (j.IsDictionary)
{
foreach (KeyValuePair<String,JSONObject> x in j.Dictionary)
{
result += (x.Key + " --- "+x.Value.String);
}
}
}
}
*/
}
return list;
}
вы, конечно, можете изменить пост и запрос на то, что вы хотите искать в Facebook Graph API
и есть еще один способ сделать это, используя FQL и его очень просто
надеюсь, что это будет полезно.