Export all comments from all post in facebook-graph-api - facebook-graph-api

I have a Facebook page and i currently try to see how the overall people think about my FB page so I found out that the simple way to know that is using word clouds using python
so I try using FB graph API to export all post comment but it only gives me one post
like this
{186410560371****}/comments
is there a command to help me export all post comments from all my post at once

Related

Starting using Instagram oEmbed feature

What is the correct way to start using Instagram oEmbed feature? Documentation (https://developers.facebook.com/docs/instagram/oembed/) claims that I have to pass App Review to start using the feature. And application form says Please provide a URL where we can test Oembed Read. Which I don't have because I have no access to the feature.
What I have tried with no success:
I requested instagram_oembed resource with:
app token of application in live mode
app token of application in
development mode
passed URL to a post by official Instagram account
(e.g. https://www.instagram.com/p/CQG4gZxMzzO/)
passed URL to a post
of a user who is Admin of the app
In all cases I receive (#10) To use 'Oembed Read', your use of this endpoint must be reviewed and approved by Facebook. To submit this 'Oembed Read' feature for review please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review.
Example of the request I do https://graph.facebook.com/v11.0/instagram_oembed?url=https%3A%2F%2Fwww.instagram.com%2Fp%2FCQG4gZxMzzO%2F&access_token=appAccessToken
We're also suffering from this issue, but so far, we thought we already figured out how to do that.
Big picture
Facebook had not sorted this thing out correctly. Or at least, we don't know why they put such a restriction to this API.
The official document is not correct. (or at least not accurate for now, for some part)
Which part was not correct?
The access token part is not right. Or at least, it's the most confusion part.
How can we resolve this?
Use the Graph API Explorer
Adjust your token(App token, Client access token, user token) with the official URLs(see below) to see if you can get the result
most of us should be able to get the result with user access token, which means you have to access this API after login!
Integrate into your app for review
The review page is also confusing:
Please provide a URL where we can test Oembed Read. Include the URL of a page, post or video from our official Facebook or Instagram pages, or the pages themselves., it means you can only use links like https://www.facebook.com/instagram or https://www.facebook.com/facebook
With that in mind, so far, the only way to get approved is integrate your oembed usage into your normal UI with facebook user access token ready
Question to the big picture
So, we have to ask user to login with our facebook app, then we can provide this oembed read API returned embed HTML? I'm afraid that's what we have now.
big companies might be able to apply for App Token, I guess in that scenario, facebook login is not necessary
for small companies, indie developers, hmmm, I don't know any better solutions so far.
I have run into this too. I do not have an answer at this time, I just want to report on the frustrations of their 'app review' process. Which makes it feel like you are unlikely to get it to work any time soon.
We have a custom embed code for our weblog authors to use (a shortcode kind of thing) which does the oEmbed call. We just take the HTML from the resulting JSON, and insert it into the weblog article page, and that is it. It stopped working, presenting this same error - in live mode, and in development mode.
The kicker is, I then tried submitting it for app review. Filled out everything I could to the best of my knowledge. Provided them a test account and post on our weblog to show the shortcode editing and expected placement. We got rejected. Why? Your embedding resulted in an error, we can't see it in action to approve you.
Yes. The error I am getting is that I need my 'app' to be reviewed and approved.
This is an infuriating process. This is the only Facebook / Instagram API feature we use at this point. No user data. No attempt to make an Instagram clone app or anything like that. Just an embed.
And they are making this simple use case as impossible to use as they can. And the documentation also feels like an infinite loop. They say users of the old Instagram embed call have until September 7 2021 to get approved. But the call does not work at all because we are not approved. So we cannot get approved.
Same loop here. I've managed to report it to Facebook team and get answer "Just submit your Instagram post URL"! I can't believe it, its can't be so simple. I've confirmed it few times with Facebook team person and.... get rejected!
Also, second form in App Review process will LOWERCASE all of your links and I've spent few days just to explain it to reviewers and support person. Still rejected after submitting proper url. This is insane.
My another attempt was about to build a test page where I can auth via Facebook account, parse connected Instagram accounts and GET embed endpoint with user access key in hope that reviewer HAS access to oembed feature - REJECTED. I can't even find what permission I need to add to auth URL to obtain oembed thing.
Will update my answer with new information later.
UPDATE: After reporting about the issue with lowercase URL in submission form they just APPROVED my app without APP REVIEW. Well... Facebook style...
I had exactly the same problem recently. Updated the packages with compose, changed the API version from 10 to 11... without any change.
The error was also occurring in development mode, it didn't make sense that Facebook was asking to approve in dev mode.
For me, the problem came from the management of scopes in my application, depending on the version of the Facebook API used.
My advice: check the scopes defined with API version in your code first.
I had the same issue and the solution is very simple. The only thing you need to do is copy paste an instagram url in the input field saying: Please provide a URL where we can test Oembed Read.
I did the this link: https://www.instagram.com/p/G/
Which is actually the first instagram post :) Got approved. Hope this helps everybody!

Facebook graph api post status

I'm trying to post on my own feed , but im not able to ,as this page says we cant on feed directly but by using 'share' link
can someone please explain? how to post on feed using simple curl command?
https://developers.facebook.com/docs/graph-api/changelog/breaking-changes#login-4-24
It is no longer possible to post to a user profile with the API (or with curl), the docs are very clear about that. You can only use the Share Dialog.

How to find most commented article (using disqus)

I am using Disqus for commenting on articles in my site. I want to find the most-commented article using the API. Could you provide me with some pointers?
This API endpoint will load the most-commented articles on your site within an interval up to 90 days: http://disqus.com/api/docs/threads/listPopular/
An API request for you would look like this:
GET https://disqus.com/api/3.0/threads/listPopular.json?api_key=YOUR_API_KEY&forum=YOUR_SHORTNAME&limit=1&interval=90d
Additionally if you wanted to also get the top comment from that article, you can add &with_top_post=1

How to know if a comment on a page post is hidden in Graph API

We are looking for a way to find out, if a comment is hidden on a story on a page feed. We are using the Graph API to get the comments: [story_id]/comments with an Admin Access Token. Facebook tells us if we can delete the comment. However, there is no "is_hidden" flag or something.
Is there any other way to find out if the comment is hidden/marked as spam?
Thanks!
I'm PHP Developer, we have also used Facebook Graph API many times.
As per my expertise, I think we cannot fetch/identify only hidden/spam comments.
But yes you can get the comments for only particular user if you want.
For example:
1.) Get id of a fanpage with public graph data: http://graph.facebook.com/cocacola - thumsup has 507267189335315.
2.) Get ThumsUp's "like plugin" iframe display directly with some modified params: http://www.facebook.com/plugins/fan.php?connections=100&id=40796308305
3.) Now check the page sources, there are a lot of fans with links to their profiles, where you can find their profile ids or nicknames
4.) If you are interested only in profile ids use the graph api again - it will give you profile id directly
I hope you will find my answer appropriate.
If you are getting some other solution, please share
Thanks,
Shreyas
By now, finding out if a comment is hidden can be achieved via the is_hidden flag.
More detailed answer on a similar question
Facbook API docs for comment endpoint

Posting questions to groups via the graph API

I am new to the Facebook graph API and I am currently developing my first app using the php-sdk. I am looking to be able to post questions on a group via the graph API. I have come across Facebook's blog post here http://developers.facebook.com/blog/post/635/ which gives an example of posting a question to a page, but I have found little documentation on posting questions to groups. I have attempted to post a question to a group with the following code, which is throwing an 'Unsupported post request' error. I don’t know why it isn’t working, as I have no problems posting questions to a users feed with this code.
$params = array(
'question'=> $question,
'options'=> $options,
'allow_new_options' => false
);
$questionpost = $facebook->api('/' . $ID . '/questions', 'POST', $params);
Any help would be appreciated.
This is odd. You cannot (as well as I cannot) find documentation on how to post a question to a group via the API. Then you try posting a question, just like you can to a page (per the blog post), to a group and receive an error. Well, I assume that pretty well confirms that you cannot post a question to a group using the API.
From: https://developers.facebook.com/blog/post/635/
We are now adding the option to write them. To create a question for
the current user, issue an HTTP POST to the questions connection like
this:
Here's a PHP example that shows the optional parameters: options and
allow_new_options -- and how to post a question as a Page using its
access token:
Please notice they did not say you can do this for groups. Only users and pages.
You should file a bug with Facebook asking them to implement the ability to post a question to a group. Please report back here the bug number so other stack overflow users can see/track the bug.
Thanks!
Happy coding.