How to retrieve my own comments from a public group on Facebook - facebook

I am attempting to retrieve my own comments from a public group on Facebook, using the Facebook Graph API. This is a public group of which I am not an administrator.
I have attempted a number of strategies, but to no avail so far. I keep hitting brick walls, e.g.:
The xxx'yyy' is only accessible on the User object after the user grants the 'user_managed_groups' permission.
If I go on my own profile activity log, I can see those comments, so I would have expected there should have been a way to retrieve those programmatically through the Graph API.
Am I mistaken?
UPDATE
On the chance that I am indeed mistaken, I have sent the following feedback to Facebook:
I would like to b able to retrieve my own comments from a public group on Facebook, using the Facebook Graph API. This is a
public group of which I am not an administrator.
At the moment, the Graph API documentation (v2.12) states that to read the feed I need to provide a user access token for an Admin of
the Group with the user_managed_groups permissions.
Please note that if I go on my own profile activity log, I can see those comments, so I would have expected there should have been a way
to retrieve those programmatically through the Graph API.

Group feeds are only accessible with an access token of a group admin now.
Please note that if I go on my own profile activity log, I can see those comments, so I would have expected there should have been a way to retrieve those programmatically through the Graph API.
The main difference is, that you are one single person looking at your own data. But if I create an app and have a hundred thousand people log in to it and it was possible to read that data, then I could accumulate it for whatever shady purpose ...
(Now with the feed of a public group that might seem a little over the top, I know - but I think the general idea is to make automated data collection harder.)

Related

Get Facebook group posts without being an admin

Is there a way to get all the posts from a public group on facebook without the graph api/group api?
I am a member in the group but I'm not an admin so I don't have the permissions to do it with the formal facebook api.
But I can access all the data with my browser so I can see all the posts throw the web GUI.. So I thought there's might be a way to download/get all the posts from a group without the need to be an admin..
Thanks!
Is there a way to get all the posts from a public group on facebook without the graph api/group api?
Circumventing the APIs would not be allowed to begin with; you have to use those, if you want to gather any data by any automated means, everything else would be against the ToS.
There is no way to access group posts via API, if an admin does not “install” your app in the group first.
The group visibility does not matter in that regard, it is the same for private or public.

Access private facebook group's posts using Graph API

I've been trying (with little success) for a while now to get all the posts from a private group that I am in and display them on our website so that the people with
out Facebook can still see them. I know this is possible with a public group (which our group cannot be), but is it possible with a private group?
I've tried access tokens on the Graph API Explorer, but that just returns:
{
"data": [
]
}
I also read that to access private groups the user needs to log in as a user in that group. However, this would be pointless as the whole point in trying to do this is to allow people without facebook to see the group's posts.
Thank you all
Ben
The whole point of a "private" group is that only logged in group members can see the feed.
That being said, you can only use the permission user_managed_groups to get the group feed with the /group-id/feed endpoint. You need to use a User Access Token for this, with the correct permission, and this only works as group admin. You can't read the feed of a group just because the user is a member of the group - at least not anymore.

Get Facebook user work

I'm trying to write some application that scan user's group posts. When I read the group feed posts using the API I’m interested to get some information on the one who posted this post ('from' field). The graph API today gives only the id and the name of this person. I'm interested also in his work place. I tried taking the user id and to access the / resource and to get his work field , but this field is not returned. When I’m looking on the same user profile in Facebook I see his work place is public, even I’m not connected with him.
Anything I can do to get this user work with the existing Facebook API?
Normally, if the work history info is not public, you'll need the "user_work_history" permission (see https://developers.facebook.com/docs/facebook-login/permissions#reference-extended-profile).
If it's public, you can try calling the
/{USER_ID}?fields=id,work

How to get insights on a Facebook fan page without user login

I'm trying to figure out how to get the total number of comments, posts, likes and fans for any given Facebook fan page and date range using the Facebook API's. I need to be able to do this without the user having to log into Facebook to give the app permissions. This does seem to be possible, as this site is able to do it https://app.conversocial.com/profiler/ .But I don't know how they are doing it.
I've looked into the 'insights' fql table, but this always seems to return empty results. And I've also looked into the 'link_stats' fql table but this doesn't allow a date range to be set.
Does anyone have any idea on how to do this?
You are right. What they are doing is not possible by using the normal Graph API or/and the FQL.
However, Facebook also provides support for two other APIs:
Public Feed API
Keyword Insights API
Access to these APIs is restricted to a limited set of media publishers and usage requires prior approval by Facebook.
I think that they are using the Public Feed API. The documentation of the Public Feed API lists some of the publishers that have been using this API and the site you've mentioned in the question is not in the list. The documentation also doesn't mention anything about getting the Page Insights, but I think it might support this feature (as I see no other way of doing it).
Or, they might be using any other such restricted API which is not yet available to the public and not even documented on the developers website, but is currently in beta/testing phase.
To get the number of fans and the talkabout count, just query the appropriate Open graph ID for the relevant page. For example, for Coca Cola (https://www.facebook.com/cocacola) this is done via
https://graph.facebook.com/40796308305
To get all public infos (Posts etc) use the following request
https://graph.facebook.com/40796308305/feed?access_token={ACCESS_TOKEN}
where {ACCESS_TOKEN} can either be an App Access Token or a personal one. Consider that you can only see public entries.
The ability to query the date ranges is not provided via Facebook ad far as I know. I guess the https://app.conversocial.com/profiler/ application queries each page that is in its index once a day, and saves the results. That's how they're able to provide historical data.
You can try with the following FQL queries or graph API requests for facebook pages,
Graph API
http://graph.facebook.com/nb4cinema
FQL
SELECT name,about,description, fan_count,talking_about_count FROM page WHERE username= 'stackoverflowpage'
In case of FQL tables:
To read the page table you need
no access_token to get public information, or information about public pages that are not demographically restricted.
any valid access_token to get all information about a page that the current session user is able to see.
We have a test fan page. This has poor figures (<10 fans). Statistics are not available due to the lack of fans and likes on that page.
Allthough, conversocial spits out some statistics. They mixed fans and likes to some extent and so my impression is, that they simply parse the page code in order to get what you see.

List Facebook Page events on website for a Venue using FQL or Graph API

I am helping out a friend with a site for a venue that lists all events on FB with a location, ticket URI, time, etc.
I have found lots of info on how to get the data, but what I am unclear on is how to get public events without being logged in to FB.
What type of tokens do I need to have a website simply pull events data and display it to visitors?
Basically, what I am attempting to do is show a set number of upcoming events and assume that the visitors to the site are not logged in to FB.
On this page, https://developers.facebook.com/docs/reference/fql/event, it says this:
Permissions
To read the event table you need:
a generic access_token for public events (those whose privacy is set to OPEN)
a user access_token with user_events permission for a user who can see the event for non-public events
an app access_token with user_events permission (for non-public events, must be the app that created the event)
a page access_token with user_events permission (for non-public events, must be the page that created the event)
I am not looking to get help with the code really, I am just having trouble figuring out how the access/auth process works.
It appears FQL may be the best option so I can do queries based on date ranges, but alas, I am stuck on the access/auth/token part.
What do I need to have in place to be able to list a Page's events on a 3rd party site?
If anyone has any advice there, I would appreciate it. Thanks.
Just to explain to others, you cannot get ALL the events in the city by graph search. You need to refine it either by user details or some other metric.
I figured it out.
This question helped, but was not correct and there is a syntax error in an answer:
Get Facebook events from public fan page
From what I found, you need to become an FB developer, create an app, get an ID and secret.
Use the SDK (PHP in my case), and this question had a good example of returning the list I want:
Link from ticket_uri is opening a blank page
I am having the same issue though of getting blank pages on the ticket link if the user is not logged into FB.
But my original issue is solved.