I wrote a short script for personal use only which is designed to get easier access to public content on facebook pages. The script is supposed to export the contents of public posts on a given page to an excel file.
I understand that for an app in live mode, I need to submit a request for page public content access in order to get information from pages that I don't manage. However, this script is not intended to go into live mode at all (for example, it doesn't have a user interface) as it is for my own use.
How can I get page public content access without turning the script into an app in live mode?
It does not matter if you go live or not, if you want to access Pages you do not manage, you have to apply for Page Public Content Access. Else it would be easy to just keep in unpublished and redirect user calls to your code as a proxy to the Graph API. Facebook needs to know how you want to use the content.
Related
Is there a way to test an app implemented Facebook Graph API required Page Public Content Access permission?
I was testing the {page_id}_{post_id} endpoint in Facebook Graph API Explorer to get a post, but got the error message:
This endpoint requires the 'pages_read_engagement' permission or the 'Page Public Content Access' feature. Refer to https://developers.facebook.com/docs/apps/review/login-permissions#manage-pages and https://developers.facebook.com/docs/apps/review/feature#reference-PAGES_ACCESS for details.
This error applies to both random pages and pages that I own. I couldn't use it at all. The app I've planned to do is mostly based on Facebook posts so I may say this is it's the main function, so I just can't have the app reviewed until I can test this endpoint successfully.
What can I do to make it work? Any help would be appreciated!
It turns out I chose the wrong type to create my facebook app. I chose to create a "Business Connected Experiences" app instead of a "Manage Business Integrations" one, so I couldn't fully access to the permissions I need to query on my own page. The former only doesn't provide me the pages_user_read_content and the likes, so it was unable for me to read comments from posts. Besides, I also use an user token instead of a page token (Thanks Lars for pointing this out for me).
So, I just create a new app with the right type and everything turns out well.
Hope this will help someone someday.
I would like to write a backend application that retrieves public posts from Facebook pages that I don't manage, using the graph API. As an example the last 5 posts of the local pub page.
According to the feed documentation, I need to manage the page or request the Page Public Content Access permission.
The Page Public Content Access permission is mentioning the following as allowed usage: 'Provide aggregated, anonymized public content for competitive analysis and benchmarking'.
This sounds very restricted to me.
Is it possible and allowed to let my backend application retrieve public Facebook posts and show them in my mobile application as feature?
Most references on StackOverflow refer to issues that are related to API changes that have been made.
I'm trying to understand what is allowed and what not but it is hard for me to extract this from the documentation on the developers page.
I'm looking to see some info about my facebook contacts, and I want the info to be overlayed on the currently open website.
Currently, I'm trying to do this via a bookmarklet.
Is it possible for me to overlay a div over the currently open web page and populate it with a functioning facebook login button (if the user is not logged in)? Are there publicly available working examples of something like this?
It is probably not possible to simply embed Facebook within an iframe because Facebook blocks people from embedding their pages within frames or iframes by putting this into the response header, "X-Frame-Options: DENY". This is most likely to prevent click-jacking and similar security exploits.
To test this, enter any page from Facebook into http://savanttools.com/testframe
Facebook has an API which allows you to do many things, but it requires server side code, and can not be done simply with a bookmarklet.
There is also always the brute force method where your server scrapes data from any website you want it to. Then that data could be put into a bookmarklet.
Finally, the same thing could be achieved by writing an add-on or a user script without using a bookmarklet at all.
How can I test the 'Like' button functionality and OpenGraph data embedded in my pages while my site is not publicly accessible?
I have an internal test environment where my site is being built and tested. The environment is locked down by IP to a certain set of machines. I want to be able to verify the end-to-end scenario of performing a 'Like' and seeing the parsed OpenGraph data on a user's Timeline without having to open up my site to public access.
I know there's a user agent for the Facebook crawler, but allowing by user agent is risky as anyone can send any user agent string. Ideally, I'd like to lock it down to Facebook's crawler's IP range without having to parse logs to find what one or two of those IPs might be (I assume there's quite a few machines crawling the web for data).
My problem today is that I can click 'Like' and have it show up with a plain URL back to my site, but the crawler can't reach me since the page effectively doesn't exist for it when it hits my server.
How can I test the 'Like' button functionality and OpenGraph data
embedded in my pages while my site is not publicly accessible?
You really cannot do that. It has to be lint-able by Facebook. See: https://developers.facebook.com/tools/lint Be sure your page is publically avaible and able to be linted by the facebook linter tool.
This works fine with four social network previews: https://chrome.google.com/webstore/detail/open-graph-preview/ehaigphokkgebnmdiicabhjhddkaekgh?hl=es
It doesn't support the like button, just the preview.
From my localhost...as "proof of solution"
I understand that an access token is needed to access an individuals private content when using the graph api. What is considered private in a fan page and do you need an access token to access all fan page content? When running a word search with type=posts in the graph api we expect only public content, is this the same for fan page searches and if not, is there really any need to have an access token when searching the graph api?
I have not finished my app yet but when just plugging into a browser
https://graph.facebook.com/search?q=watermelon&type=post
that works so why would I need to register my app. Should this not work if I set up a webrequest method?
Registering an app doesn't hurt, its easy and if something was to go wrong, they will suspend/ban your app ID rather than your server's IP. Better IMHO!