hi i'm trying to display facebook albums of a page onto my website.
i found this: http://codepen.io/dejanstojanovic/pen/QjwLZp and this does pretty much what I want to accomplish.
$(".fb-album-container").FacebookAlbumBrowser({
account: "natgeo",
accessToken: "775908159169504|cYEIsh0rs25OQQC8Ex2hXyCOut4",
my only concern is: are the account and the accessToken ok to out in the open like that? are there any security issues with it? and if so, how would I go upon hiding them while still accomplishing the script?
it'll be a wordpress site so maybe some workaround with php if necessary?
thanks.
In this case you will use the client token from Facebook Developers. This token can be visible.
The account is the slug of the FB page, that is a public name. In your example:
http://facebook.de/natgeo
To create this token you must log-in to Facebook Developers, create an App assign this app to your website and at the Settings > Advanced > Security there is the Client Token you can use for your application.
Related
I am trying to fetch the latest Facebook posts from our company's page to show them on our website. It already worked until a few weeks ago, Facebook unfortunately changed some of their security guidelines. Initially I sended some requests to the Facebook Graph API using PHP, the App ID, the App Secret and the User Token to create an page accesstoken and fetch my company's posts.
Thanks to the new guidelines new created Apps do not have the "manage_pages" permission you need to create an page accesstoken. To recieve this permission you have to get your App reviewed by Facebook which seems quite laborious to me.
Can you think of another way to fetch my posts? I mean those are posts from a page I created. I do not really understand why there are so many security issues.
Thanks!
You don’t need to get your app reviewed, if it is not intended to be used by the general public.
App Development FAQ: My app is only used by a small number of people, who are all listed in the Role section of the App Dashboard - do I need to go through Login Review?
No, it does not have to be reviewed. If your app is only used by a very limited number of people […] it's completely normal to list them all as having different roles in your app's dashboard. They can be listed as Admins, Developers or Testers
Instead of using "https://graph.facebook.com/v2.8/me?..." to fetch just posts from my own pages I am now using following URL to fetch any public posts:
"https://graph.facebook.com/v2.8/{PAGE-ID or PAGE NAME}?fields=
name,picture,feed.limit(100){full_picture,created_time,message,likes,
comments,type,link}&access_token={USERTOKEN}"
I apologize in advance if this question is horrible.
My goal is to have my website grab data (events) from one specific facebook page that I own, and then display that data on the appropriate website.
I'm new to the facebook graph API. I downloaded and set up the PHP SDK to use on my website.
I created the initial $fb object as it stated to do within the SDK "Getting Started" page.
However, the next step in the system is creating a way for users to "login" and with this it generates the required access token.
On my site, I have absolutely no reason to have a user login.
I am so lost, that I am not even sure what to ask.
I guess, what do I have to do so that I can get an authorization token that will grab public data, without having the visitors to the website authorize an app or login.
I have searched a lot over the last few hours, but the only thing i can find is the document on how to have users log in to get the access token.
Any answer or documentation linked would be so greatly appreciated. thank you.
So I'm trying to play a little bit around with the Facebook API and have read through their webpages (developers.facebook.com) and watched their video tutorials. But I don't think they have been good at explaining stuff to me. Could someone redirect me to a webpage or explain how I can authenticate a user and get his permission to do certain things (for example read his home feed) without using the facebook login plugin for my website login-process?
I want the user to use my login-function to log on to the page, and then choose Facebook from a drop-down menu. Then it will take them to a /facebook.php site which authenticates them and they grant some permissions.
How do I do this? What kind of code do I have to include to my website?
Thanks for all help!
Authenticating Facebook User without using Login Button
JavaScript : http://developers.facebook.com/docs/howtos/login/getting-started/
PHP : http://developers.facebook.com/docs/howtos/login/server-side-login/
I searched in Stack Overflow, Google, etc, but I can't figure out how to show my stuff from my Facebook on my website. I tried some solutions and each one prompted the login dialog and visitors had to log in and accept my application (I've created one to test).
Many answers here were too generic, I didn't understand them that is why I'm asking.
I want something that would let my website "log in" to Facebook and show my status or photos to visitors without them needing to accept an app or log in into Facebook with their account.
I tried a facebook-php-sdk example with my AppID and AppSecret and it asked me to log in.
Also, github.com/facebook doesn't have an SDK for Python similar to facebook-php-sdk
You could write a script (eg. using the FB PHP SDK) that uses a long-lived access token to fetch your FB data and then store the data in your backend database (or other store for your website). To Facebook, your script will look like an app and your machine will be the only 'user' of that app. Note, long-lived access tokens are good for 60 days max. You could also try using an App Access Token to fetch basic info. App Access Tokens don't expire.
This might not be exactly what you are looking for since you posted this with the php and python tag, but it might solve your problem.
If you're website is powered by the wordpress engine you can use If-this-then-that : https://ifttt.com/
It basically allows you to create "recipes" with something like:
if new status on Facebook then create post on wordpress
The post will not require others to log in to Facebook.
This is without writing a single line of code only a couple of mouse clicks. So I'm not sure if this satisfies your needs.
Last December, I set up an app for a client who wanted to pull their public facebook posts into the footer of their website.
I was using this URL to pull the message, create time and permalink and when I wrote it, all was good:
http://api.facebook.com/method/fql.query?query=SELECT%20message,%20created_time,%20permalink%20FROM%20stream%20WHERE%20source_id=138631878804%20AND%20message%3C%3E%27%27%20limit%203
Today they reported that it was no longer pulling their information. I put that url into a browser and the result is "Requires valid signature"
I've gathered from google that I need something called an access_token, also I've seen where I can use the php sdk but then I need an appId and a secret token.
At this point, I've read so many different sources that I am thoroughly confused. The FQL query above represents the full extent of my Facebook programming experience. It looks like maybe I want the Graph API, but I don't want anyone to have to sign into anything.
Can one of you guys who are more versed in the voodoo of facebook nudge me in the right direction to do this:
From PHP, pull public messages from the stream table without forcing a user to log into facebook.
Thanks!!
To pull posts from a publicly visible Page on Facebook, you can use any valid access token. For most sites managing a page, this will be a page access token retrieved via one of the page's admins authorising your app to have access to their pages, but that might be overkill for your use-case.
Probably the quickest solution is to just create a new App ID for the site, get the app access token for that App (see 'App Login' on https://developers.facebook.com/docs/authentication/ ) and then use that access token to retrieve the posts.
I found several links all from a simple Google search.
Duplicate question: https://stackoverflow.com/questions/3298836/how-you-get-access-tokens-for-facebook
http://benbiddington.wordpress.com/2010/04/23/facebook-graph-api-getting-access-tokens/
https://developers.facebook.com/docs/authentication/