Windows服务的Facebook C#SDK建筑 [英] Windows Service Facebook C# SDK Architecture

查看:232
本文介绍了Windows服务的Facebook C#SDK建筑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有什么,我们认为不应该是一个罕见的情况,但无法找到任何指导。

We have what we believe should not be an uncommon scenario but cannot find any guidance.

我们已经有多个页面为每个我们品牌的一个帐户。我们需要它运行unatended来检查prescheduled职位数据库之后定期进行岗位到各个页面的Windows服务。

We have one account which has multiple pages one for each of our brands. We need a Windows Service which runs unatended to periodically make posts to the various pages after checking a database for prescheduled posts.

我们看到的唯一的问题是身份验证。虽然Twitter的API也使用OAuth的,我们能够从Twitter获取访问code永不过期,并用它来使我们所有的API调用。我需要的是等值的Facebook的API。由于缺乏这一点,我需要一种方法能够做什么,我上面描述。

The only problem we see is authentication. Even though the Twitter API also uses oAuth, we are able to get an access code from Twitter that never expires and use it to make all of our API calls. What I need is the equivalent in Facebook API. Lacking that, I need a way to be able to do what I describe above.

在此先感谢您的帮助。

〜DCT

推荐答案

我刚刚做的一个窗口服务类似于张贴到我自己的饲料东西。我用了Facebook的SDK(http://csharpsdk.org/)

I've just done something similar from a windows service to post to my own feed. I used the facebook sdk (http://csharpsdk.org/)

正如你在你的问题提出的问题主要是做身份验证。最后,我发现这一点:

As you suggested in your question the problems are mainly to do with authentication. In the end I found this:

<一个href="http://developers.facebook.com/docs/opengraph/using-app-tokens/">http://developers.facebook.com/docs/opengraph/using-app-tokens/

一旦你得到了你的应用程序的设置上要张贴到帐户正确的权限,你可以使用你的浏览器中得到一个永不过期的令牌(只添加了应用程序ID和应用程序密码):

Once you've got your app setup with the correct permission on the account you want to post to, you can get a non-expiring token just using your browser (just add in the app id and app secret):

GET https://graph.facebook.com/oauth/access_token?
        client_id=YOUR_APP_ID
       &client_secret=YOUR_APP_SECRET
       &grant_type=client_credentials

这将返回未过期的访问令牌,我只是粘贴到这一点我的app.config ......

This will return an access token that doesn't expire, I just pasted this into my app.config....

另外: 需要注意的是,因为你不使用用户访问令牌,所有呼叫公布代表用户的信息应参考/ [USER FB ID],而不是/我。

Also: Note that because you are not using a user access token, all calls to publish information on behalf of the user should reference /[USER FB ID] instead of /me.

这篇关于Windows服务的Facebook C#SDK建筑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆