PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, February 11, 2022

[FIXED] Get facebook page reviews automatically

 February 11, 2022     facebook, facebook-php-sdk     No comments   

Issue

I am trying to get my page reviews and insert them in the database. The problem is that i need to get this into a cron job. So to access /{page-id}/ratings i need to follow this steps:

  1. Need to log in with Facebook in order to get the user session
  2. After that, if the user is the admin of the page i can access /me/accounts and get the page token
  3. After i take the page token i can get the reviews/ratings by accessing /{page-id}/ratings

I must do all of this automatically. How can i get the user session to use it every time without logging in again.


Solution

You need to use an Extended Page Token that is valid forever.

If you don´t know how to generated Extended Tokens, here are some articles:

  • https://developers.facebook.com/docs/facebook-login/access-tokens/
  • http://www.devils-heaven.com/facebook-access-tokens/
  • http://www.devils-heaven.com/extended-page-access-tokens-curl/

Basically, you just need to generate an Extended User Token and call /me/accounts with that one to get an Extended Page Token.



Answered By - andyrandy
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing