Reading user's posts to pages - facebook

For a given Facebook user, is there a possibility to read all posts that he's made to any pages? On FB web, these can be found in the activity log, but so far I couldn't find a method to get them via API.
Both /user/posts and /user/feeds only contain status and profile updates, not posts to pages. I know I can read /page/feed and use paging to find this user's posts for any page the user likes, but how about those he doesn't?

No, outside of FQL, there is nothing in the API that accomplishes this. I'd imagine this to be a pretty data intensive call with minimal use cases however, so I don't think this will be introduced anytime soon.

Related

Get a notification when a facebook page post is made

I follow a facebook page which has some interesting posts and they post regularly. I want to write a python script that gives me a notification whenever the page posts something. Is there a way I can accomplish this in Python?
I have searched a bit, seems like graph API is the way to go. However, all the tutorials I have seen online give a way to scrape some data or get post information. I do not seem to figure out a way to detect when a new post is made.
How should I accomplish this task?
Notifications for changes or new posts can only be made with Webhooks - which are only available if you manage the Page. Scraping is not allowed on Facebook, so there is no way to get notifications for Pages you do not manage.
You could only check with the API on a regular basis, but you would need Public Page Content Access for that, and you may have a problem with API limits if there are many Page Posts or Pages you want to check.

Facebook Ads API - Read Comments

I'm trying to read the ads comments using the Facebook Ads API v2.8. I have reached all of my campaigns and ads, but I didn't find in the docs the path for the comments.
I've searched over internet and everyone says that it's possible, but, or the post is too old or they dont explain properly (maybe I didn't understand properly).
Obs.: I'm using CURL, but if you have some JAVA code, it's alright for me.
Ads are merely a wrappers around posts (in most cases). Typically these posts can be unpublished, but you can promote published posts too.
All the social activity like likes/reactions, comments or shares happen at the post, not at the ad. When you realize this, then it's clear the comments need to be read from post itself.
To get post ID from your ad ID you can use following endpoint
/<ad_id>?fields=creative{effective_object_story_id}
From there you take the effective_object_story_id, which is your post's ID (you can even open https://facebook.com/<post_id> in your browser)
The post's comments can be accessed on following endpoint
/<post_id>/comments

Facebook Graph API insights

I'm new on working with Facebook and honestly I found it very confusing, terminology and documentation seems to be very ambiguous in many cases. Can somebody please help me out with a plain english explanation on how I can achive the following?
Post and image to Facebook (on the user page) and then check the stats (insights) of that post.
Till now I have managed to:
1) Create an app
2) Post the image on the user page with the desired message
I'm not able to understand how I can retrieve information about the particular image which was uploaded through my app. I want to know how many people have viewed that image, how many likes did it get, how many times it was re-shared.
Is it possible at all?
I'm posting to /photo not too /feed and I will like to keep it this way if it is possible.
Sorry if this was answered already but I spent a few hours trying to find an appropriate answer but wasn't able to get the right documentation.
UPDATE 1
After having a couple of days off from this topic and receiving the first 2 answers, I took another dive into this. Now I have tried the Graph API Explorer as suggested, and using the ID of a POST I can get some details about the POST, but the insights aren't showing anything, just next and previous.
My goal is to be able to gatther some stats about the pictures uploaded through the app. If this is not possible directly what should be the approach I need to take?
I don't believe a personal /photo has /insights attached to it - the Insights Object documentation page suggests that they do not - but you should be able to get likes, shares, and comments via the API.
It would appear FB has launched a redesign/reorganization of its documentation in the last couple of weeks, but the documentation for the /photo graph object is here -- you will need the user's Access Token, and the API endpoints you're looking for each have links to their own documentation pages there, including example code for each type of request.
Edit (summarizing discussion in comments):
There is no method via the Facebook API to gather insights for all photos posted to individual user timelines via an app. The app can gather likes, shares, and comments for each of those objects individually via API requests, and can make API requests for insights for photos posted to its own timeline. Neither of those options solves the intended use case here.
I'd recommend a solution that uses Sharing rather than an app integration, as this allows for better access to insights on the photos being shared. This is also a much simpler integration, and less brittle wrt future Platform changes. The main tradeoff is that the original photos being shared are expected to expire after a couple of months -- if this is unavoidable, I'd suggest implementing a redirect for requests for expired objects on the site.
We are able to get different kind of photos or picture Using Graph API
like as below:
1.Page Photos
Photos for a Facebook Page.A Page Access Token is required for all methods.Find here
2.Page Picture
Picture belonging to a Facebook Page. Find here
3.Photo
Represents an individual photo on Facebook. Find here
4.User Photos
Photos for a person.Find here
I hope it's helps you.

How to get Likes of Instagram photo posts in Facebook Graph API?

I am developing an app that processes <used_id>/posts connection to read the posts a user have made and count the likes and comments that have been received.
Yesterday I noticed that Instagram photo posts do not appear in posts connection. After a little search I found this Posts from Instagram not showing up on Facebook Open Graph API after which I was able to see Instagram photos in Feed connection if permission user_actions:instapp was added (or friends_actions:instapp for friend posts).
But two problems remain:
1) The posts still do not appear in Posts connection, which is more convenient for usage in my case because I am not interested in Posts of other users which may appear in Feed.
2) Even if I use Feed connection the posts do not have Likes field filled, does not matter whether I specify it directly or not. I assume that the same goes with Comments. Therefore in my case Feed is also useless because I need Likes data.
The only solution that works is by using <user_id>/instapp:take - there I get all photos also with Likes. So I might use it, but the trouble is - then I need to do double API call, because Instagram posts are not the only in which I am interested in (I still need to call <user_id>/posts).
I have submitted this bug report: http://developers.facebook.com/bugs/131821543664928
Perhaps someone has an idea for a better solution than calling instapp:take?
Thanks!

Remove Facebook page likes automatically with Facebook API

As detailed in the my post on IT Security Stack Exchange, I am the administrator for a page with a many recent unknown (an undesired) likes.
It was suggested to me to learn the Facebook API and write an algorithm to remove likes automatically, based on thresholds (ex.: remove a like if the user has a suspicious amount recent likes).
I'm aware of the many other posts discussing issues with retrieving the like count for a Facebook page, but was unable to find any posts discussing removing likes as the page admin.
Is this possible to achieve? If so, how would this be done?
Try looking into using the block method.
PAGE_ID/blocked?uid=USER_ID_YOU_WANT_TO_BLOCK
This should do the same as removing the like. I am not sure whether unblocking the user resets the like or not (works on Twitter) so you can look into that as well with a HTTP DELETE on the same call.
As far as I know there is no way to explicitly remove a like from a page.
For more information see http://developers.facebook.com/docs/reference/api/page/#blocked