开发者

Facebook Application authorization for cron job

I have an facebook application which sends links to fan page walls. Everything is wo开发者_运维知识库rking when i call the .php file from my browser but when i call the same page from cronjob it can't run the facebook application because of the authorization problem. I don't want to enter my username/password to the php file. Is there a setting to authorize the cronjob and post to page walls?


I don't think you can authorize any facebook application using cronjobs, you have to authorize manually and then create a cron job with your wall posting link!


cron knows absolutely NOTHING about Facebook and Facebook credentials, and this is a good thing. If you want a script to do things automatically with Facebook, you'll need to embed your credentials in the script, or give the script access to some place the credentials are stored.


If this is a per user thing, you would need to have a user authenticate with your application, and request offline_access extended permission (in addition to other permissions you might need), and store the resulting access token in some kind of database. You could then publish as that user using that access token at any time (unless the token gets deactivated by them changing their password or revoking access).

If you just need to do this for your own account, you would do the same process of getting an offline_access token but you could just embed this access token into the code of your application.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜