In Graph API how can I get who mentioned me - php

I'm using Graph API to fetch my page feeds. I call
$pageID/feed?fields=created_time,object_id,story_tags,story,full_picture,picture,message_tags,message,caption,child_attachments,attachments,description,admin_creator,from
It gives me the feeds in my page which is fine. But, I also want the list of posts where anyone has mentioned my page in their posts in their own walls. I have gone through https://developers.facebook.com/docs/graph-api/reference/v2.9 but could not find a way to do that. Does anyone has any idea if that is possible?
If yes, then how?

There is the /{page-id}/tagged endpoint; but that will only return posts by other pages that have tagged yours, and only if those pages are “authentic” (which likely means verified.)
And user posts are not available at all to your app, not even if they are public - unless the user explicitly granted your app permission to read their posts.

Related

Access Shares from a Company on LinkedIn via PHP from Wordpress

I am trying to retrieve the shares of a company on linkedIn (basically just read the stream, as is easily possible on twitter) to display them on a Wordpress website in a custom HTML/CSS styling, so I only need the data. This should happen just in the backend, so no user interaction (as login etc.) should be necessary.[The end result is simply a slider that aggregates the latest social media posts, like twitter, facebook & linkedin. Works for Twitter & FB so far.]
After many hours of research it seems to me that this is not directly possible with an entirely server-side solution?
Can someone direct me if it is possible to do so? There are many php linkedin libs, but all of them seem to direct to some sort of login from which the user is redirected back? (maybe I am mistaken here).
Any help is greatly appreciated!
Take a look if they offer public rss feeds, thats the most simple way. When they offer only protected then search for developer acces from where you can get api access.

Facebook Graph API only get own posts without shared posts

I'm new to the Facebook API with PHP, and so far, I've succeeded in retrieving all the posts for my feed. But, I want to retrieve only the posts I have published, so nothing I have shared (that's what's included when I use the /posts) nor do I want messages placed on my feed by someone else (that's what I get using /feed)
Below an example of my call:
$data = file_get_contents("https://graph.facebook.com/$page_name/posts?limit=$limit&access_token=$access_token");
Any thoughts on this? Should I be using the facebook PHP SDK, or can it be done with a file_get_contents?
I have tried the "&with=" location filter, but I have no idea what that should do. Also I have tried adding "?filter=" app_$app_id, but that had no effect either.
As per CBroe's comment, this is not possible and needs additional code.

Get my posts on facebook manage page

I need get ME posts in one of my manage pages, with the new version of facebook sdk.
Example:
I'm manage on Page A, and add a post in my name Adexe Rivera, and in this page there are a lot of posts. So I want to filter only posts by Adexe Rivera.
I know for get posts on pages it's necesary /page/feed, but I need add the filter from user.
I tried with Graph Api Explorer, with this FQL:
SELECT source_id, actor_id, post_id, target_id, message FROM stream WHERE source_id = "PAGE_ID" AND actor_id = "MY_ID"
and get the information that I'm searching.
But I know that since v2.0 FQL not works for sdk, so that I need it's make the same like FQL works in this version of graph
I already tried what documentation said, but not get my posts.
A user access token is required to retrieve posts visible to that person.
Thanks in advance
Filtering is not possible, you can only use the existing endpoints and filter on your own after getting the entries. There are several different endpoints, make sure you are using the correct one. They are all documented very well: https://developers.facebook.com/docs/graph-api/reference/v2.4/page/feed
Also, an App Access Token should be enough to get access to the endpoints if it´s a public post on a non-restricted Page:
An access token is required to view publicly shared posts.
If you don´t know about Access Tokens, read those articles:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/
Finally, it is not possible to use FQL giving me the expected result, so getting the "from" field in the /PAGEID/feed endpoint, and filtering the results, I get what I wanted.
Thanks for your answers and for their penalties, I have spent several days trying to maximize the performance of the SDK facebook.
Cheers

Multilingual fan pages

I've got an algorism that is calling the Graph API to grab the posts of fan pages that we don’t have in our database (to make statistics on them).
We call the Graph API with an app token, and with “normal” fan pages (no located posts), we don’t have any problems, we correctly have all posts.
But when we try to grab country located posts, the Graph API returns to us nothing. I think it’s due to the fact that an application don’t have a language (by default), so to resolve that, I take the access token of an admin of the page and then the Graph API give me all the data I need.
My question is simple : Is there a way to grab country located data with app token ?
Thank you for your answers !
Unless you own that page, no, there is no way. This would create a privacy issue where the Graph API can be used to display otherwise restricted content. This applies to age and alcohol restrictions as well.

Why do geotargeted posts not appear in API even with accesstoken?

This has been asked before but I haven't seen a definitive answer. Hopefully someone has an answer. Basically, it seems impossible to pull any post that is geo-tageted via the API becasue it has privacy settings, that is, a country set to who can see it.
I am using https://graph.facebook.com/".$pagetoprocess."/posts?&access_token=".$att and this will pull the posts but not any posts that are geotargeted to the UK for example.
If I create an accesstoken from a user who is an admin of the page then I see all posts including geotargeted posts.
Why would this be? how can I see all posts for any page whether I am an admin or not or whether it is geo-targeted?
I would have thought that if you creaded an app in the UK and therefore had an app and secret id code from which you then generated a user access token, why would you not be able to see a post from a page geo-targeting the UK? Seems strange.
Any ideas?
Thanks
Jonathan
I would think that all posts would appear, or at least that is what it says on the api. You could try using feed instead of posts, since posts is a derivative. You might also try using:
&include_hidden=TRUE
But I'm not sure that will help.
If you have the page url, I'd be willing to see if I can play around with it in the graph explorer.

Categories