简体   繁体   中英

Using FQL to schedule posts to stream

I'm trying to understand how to make scheduled calls to FQL queries without an authenticated user initiating the query. (Similar to a cron-job, I guess)

I've experimented with trying to implement cron jobs to make FQL queries but haven't had any success.

Could anyone please steer me in the right direction?

You have 3 options:

  1. When the user enters your app use the client side authentication , get a short lived user access token and then extend it using the new endpoint for 60 days.
    For those 60 days you can use that user token and do as the permissions the user has granted allow you to. When the 60 days are over you'll need the user to reengage with your app to get a new token for another 60 days.

  2. Use the server side authentication to get a long lived user token (60 days), then the same as in 1.

  3. If you get the publish_stream permission then you can publish as the user with the app token which does not expire, as it states in Authenticating as an App :

App access tokens can also be used to publish content to Facebook on behalf of a user who has granted a publishing permission to your application.

App Access Tokens generally do not expire. Once generated, they are valid indefinitely.

You may not be able to use the 3rd option, it depends on what data you want to get from the api.
I suggest that you use the Access Token Tool to get a user and app tokena, save the app token somewhere and then test your queries in the Explorer Tool with the user token.
When the user token expires try the same with the app token to see if it can be used for what you need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM