Is it possible to display Facebook users timeline on website? - php

OBJECTIVE: I need to display latest 5 entries from users timeline on website, using PHP.
Please not that i speak about timeline of user profile - not fan page, not group.
SO FAR I DID THIS:
Registered as Facebook developer
Registered app
Obtained token
Opened url: https://graph.facebook.com/USER_ID/feed?access_token=MY_TOKEN
Voila. Feed of that user is displayed now, but..
PROBLEM: So now i have users feed, but it looks like its partially working.
It happens often that it don't displays some updates, sometimes it displays just date of the post and not the content.
However when i try to grab feed from some facebook fan page, then everything work normal.
MY QUESTION: Are we allowed to grab user timeline? If yes, what im doing wrong?

You won't ever see all the information that is visible inside the Facebook app via the api. This comes from how Facebook filters out the data. See this Facebook Developers blog post for more information: https://developers.facebook.com/blog/post/478/

Yes you are allowed to to grab user timeline posts, even with a limit, if your app asks for read_stream permission. Issue an HTTP GET request to the below URL:
https://graph.facebook.com/user_id/posts?access_token=token&limit=5

Related

Using graph api to bulk upload to facebook company page (not a user page)

I found this, but it is kinda confusing, and doesn't answer the question for me. I'm looking to upload images from my website to a Facebook page (my code works for users pages, not company pages), if there is a way to do it without having to make an application, I'd like that, but from what I've seen, that's not possible.
My code is here: http://pastebin.com/wBp1AQwG
Your link doesn't appear to go anywhere useful, I'm afraid.
Nonetheless, I'm guessing your problem here is that you need to use a Page access token not a user access token to publish to a page rather than a user feed.
See the section on Page Access Tokens at https://developers.facebook.com/docs/reference/api/page/
I've figured it out, here is a basic outline of the process for posting an image to an album that you own on a fanpage.
Get user authenticated
Get users accounts
Get albums, or create them
Post to the id of the album (ALBUM_ID/photos) with the image
It's pretty simple once I figured out the basics of the api.

PHP posting on page wall

I have a website where users can post jobs for free. How can I link these posts to a facebook page about this website? I don't want the users to login to fb.
At this moment I post them to twitter and then using selective tweets to post them on my page. But selective tweets is not able to post logo's specific for that job.
I created a fb app. Did not select anything just gave it a name and got an appID and appSecret. I dont now what to select in "Select how your app integrates with Facebook". Becouse it is not a mobile app and it is not a website with fb login.
Kind regards.
you can use share on facebook facility of facebook ,from http://developer.facebook.com.
you can easily add this to your website.
have fun!
You can do this easily via MYSQL and PHP, depending on how your current site is setup. What i would do is store the jobs into a separate table while saving, like this
(table) Facebook
pageid //numerical value
header //job title
message //job description
So that you can use it for the next part.
Create an application via Facebook and give it authentication to users and your Facebook page.
by adding this application to your page you can then call something like :
$facebook->set_user($user, $session_key);
$facebook->api_client->stream_publish($item['header'], $item['message'], $item['pageid']);
Using your keys from facebook.
Then you can run a Cron that updates every x minutes, and after it has posted it, in an array, you can clear the table for the next row of jobs.
Let me know where you are on this and ill try to help as much as possible.

Application able to post on user's Wall

I have a Fan Page and I need to post something on users Wall after clicking Like Button. Moreover I need to display different content for users who "Like" the page and for users who don't "Like" the page. Is there an application like "Static iFrame Tab" which already solves this? If not, then how to post something on users Wall? I downloaded the facebook.php file, but I haven't managed to find the required function there.
The user's 'like' status can relatively easily be returned by decoding the signed request sent by Facebook to the page.
I've built a simple fan/like gate that is available over on GitHub - it might help you get up and running.
With regards to posting to the user's wall. I would suggest using the Javascript SDK and reading the FB.ui documentation over on Facebook.

problem with description tag for FB sharer

I wanted to know how does FB sharer work. I wanted to share different things with FB when the user is logged into my website and not into my website. So i had 2 description tags i.e different for logged and not logged in users. But FB sharer is not recognizing it. It just displays only 1 description tag while sharing. I have used the FB lint also. Same problem i have there.
Does the user criteria does not work while sharing to FB?
The content that is displayed when a user shares / likes from your site is based on a scrape that is pulled every ~24hrs. If you're displaying a different page for logged in / logged out, then the Facebook servers can only see the logged out content and hence that's what's getting displayed from a share / in the linter.
If you check your server logs, you'll see a user-agent of facebookexternalhit/1.1. That's the Facebook Spider. Off the top of my head and without knowing your site's architecture, I can't really offer a good solution of how you'd provide FB with both versions, but at least you know what's causing the issue.
Well i think you should try facebook fb.ui method:
Example: http://fbrell.com/fb.ui/feed
Docs: https://developers.facebook.com/docs/reference/javascript/FB.ui/
With this method, you can easily customize your messages and also you can set different for logged in users and for guest visitors.
BTW to get that working, you should first add facebook js sdk

How can I make news feeds appear from Facebook page owner using the Facebook API?

Does anybody know how to make news feeds appear as from Facebook Page owner?
IE. I have few page admins on FB, and I have Facebook Integration on my website (PHP), and when someone posting announcements on Facebook thru the website all that feeds are appearing as personal feeds.
Thanks!
You would need to prompt the admin for the additional scope of "manage_pages", then access /me/accounts to get a list of access_token's and pages they manage, and then post a message like normal using that special access_token. There is a good walk through of this: http://www.sergiy.ca/post-on-facebook-app-wall-and-fan-page-wall-as-admin/

Categories