2011-05-26 60 views
0

我想使用Facebook C#SDK使用Facebook C#SDK要搜索地點

https://graph.facebook.com/search?q=coffee&type=place&center=37.76,-122.427&distance=1000&access_token=

在其上運行的Open Graph的搜索,但我不知道我是否應該使用查詢或POST或某種形式的FQL。

更新:據我可以告訴我可以建立這樣的查詢:

var result = fb.Get(String.Empty, 
         new Dictionary<string, string>() 
           .SelectFields(new[] { "picture" }) 
           .SelectIds(new[] { "123741737666932", "100001241534829" }) 
           .SelectField("id")); 

我可以改變fb.Get到fb.Get(「搜索」),但我不知道是什麼在那之後選擇。

回答

3

此代碼將得到你想要的東西:

Dictionary<string,object> searchParams = new Dictionary<string,object>(); 
searchParams.Add("q", "coffee");  
searchParams.Add("center", "37.76,-122.427");  
searchParams.Add("type", "place");  
searchParams.Add("distance", "1000"); 

FacebookClient fbClient = new FacebookClient(token); 
var searchedPlaces = fbClient.Get("/search", searchParams); 
+0

哈哈,你只是勉強打我給它。 :) – 2011-05-27 13:52:50

0

想通了。

Dictionary<string, string> dict = new Dictionary<string, string>(); 
dict.Add("q", "coffee"); 
dict.Add("type", "place"); 
dict.Add("center", "-37.01,31.0015"); 
dict.Add("distance", "5"); 

var result = fb.Get("search", dict);