php - How can I get facebook statuses from an account -


I am trying to get Facebook user status from my feed. Here's my code:

  & lt; Php require_once ('facebook.php'); $ Config = array ('appId' = & gt; 'my_app_id', 'secret' = & gt; 'my_app_secret', 'allowSignedRequest' => incorrect); $ Facebook = new Facebook ($ config); $ User_id = $ facebook-> GetUser (); // user_id get here ...? & Gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt ;? Php if ($ user_id) {{$ status = $ facebook- & gt; API ('/ me / posts? Boundary = 1'); // Get the post here ... "Status:" Repeat $ status ['message']; // Post messages message ...} hold (FacebookApiException $ e) {$ params = array ('scope' = 'gt;' email, read_stream, user_reference, user_boot, user_space, user_status', 'redirect_uri' = & gt; ; 'Http: //localhost/facebook/index.php', // replace with your app url); // permission = reading_stream, user_status $ login_url = $ facebook- & gt; Mill Logins ($ params); Echo 'please & lt; A href = '' $ login_url. ' "$ {E> GetMessage ());}} and {$ login_url = $ facebook- & Gt; getLoginUrl (); echo 'please & lt; a href =' '$ login_url.' "& Gt; Login. & Lt; / A & gt; '; }? & Gt; & Lt; / Body & gt; & Lt; / Html & gt;   

But the result is empty. Can someone advise me to solve this problem?

Thank you very much!

You are reading data incorrectly, it should be; $ response = $ facebook-> API ('/ me / posts? Boundary = 1'); // Get the post here ... $ status = null; Foreign exchange ($ reaction ["data"] as $ item) {$ status = $ item ["message"]; } Resonant "status:" $ position;

You can test your questions for the data format returned

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -