Facebook C#SDK v6 - 如何强制对象重新扫描?

时间:2012-05-11 23:11:50

标签: facebook-c#-sdk

我在facebook文档(here)上读到,您可以强制重新对象进行更新,以便在用户的时间轴上进行更新。

  

更新对象

     

修改Open Graph对象时,您需要告诉Facebook   刮刀重新打开页面以获取更新的信息。   有几种不同的方法可以重新擦除对象。

     

使用“scrape = true”POST参数更加自动化。发帖子   拨打https://graph.facebook.com/?id= {id}& scrape = true,其中{id}是   对象id或对象的url。响应是JSON对象   将数据抓取到网址。

那么你如何使用C#SDK进行此操作?

提前致谢, 乍得

编辑:我尝试了以下快速而肮脏的测试:

        Dim fbData As FacebookSDKInterface = New FacebookSDKInterface()
        Dim fb As Facebook.FacebookClient = New Facebook.FacebookClient(fbData.FacebookAccessToken)

        Dim fbURL As String = NavigateURL() & "?ID=" & GetPathFromDyno(e.Keys(0))

        Dim dicFBPostParams As New Dictionary(Of String, String)
        dicFBPostParams.Add("id", fbURL)
        dicFBPostParams.Add("scrape", "true")


        fb.Post(dicFBPostParams)

但我收到了这个错误:

System.Reflection.TargetParameterCountException: Parameter count mismatch. at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture) at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index) at Facebook.FacebookClient.ToDictionary(Object parameters, IDictionary`2& mediaObjects, IDictionary`2& mediaStreams) at Facebook.FacebookClient.PrepareRequest(HttpMethod httpMethod, String path, Object parameters, Type resultType, Stream& input, Boolean& containsEtag, IList`1& batchEtags) at Facebook.FacebookClient.Api(HttpMethod httpMethod, String path, Object parameters, Type resultType) at Facebook.FacebookClient.Post(String path, Object parameters) at Facebook.FacebookClient.Post(Object parameters) at Incite.Modules.TheDynoRoom.MyGarage.dtlDyno_ItemUpdated(Object sender, DetailsViewUpdatedEventArgs e) in C:\Users\Chad\Documents\Incite Systems\Development\Web Sites\DNN_Dyno\DesktopModules\Incite\The Dyno Room\Controls\MyGarage.ascx.vb:line 1156

1 个答案:

答案 0 :(得分:0)

Prabir是对的。更新到最新版本......它工作正常!谢谢@prabir!