Get Facebook Page Wall Stream - facebook

I want to get the posts (only from the band, not others) from a Facebook Page Wall (its a Band, so no private profile) and publish it on MY own site.
I hoped to get the Posts as XML or JSON and then parse them.
So I wanted to use Facebook as a news System.
But I didn't find a solution - I don't want to have the user to log in with his account to see anything - it should be just a public stream.
The only idea I found was to use twitter as an export mechanism, but that's kind of elaborate.
Does anybody have an idea?

You could use the Facebook php sdk: https://github.com/facebook/facebook-php-sdk
It ends up looking like this:
//
include('facebook.php');
$fb_config = array(
'appId' => $yourAppId,
'secret' => $yourSecret,
);
$facebook = new Facebook($fb_config);
$feed = $facebook->api("/{$nameOfFaceBookPage}/feed");
That will give you an array of feed stories.

I assume you created a facebook page for your band and it has url in such format:
http://www.facebook.com/pages/<band_name>/<page_id>
In this case you can read wall posts in json format using Graph API (no login required):
https://graph.facebook.com/<page_id>/feed

If you only want posts from "me", can't you just use the Like Box social plugin and show the stream? This plugin will only show posts from the page owner.
http://developers.facebook.com/docs/reference/plugins/like-box

I am developing a similar app and after a lot of searching finally accomplished
https://graph.facebook.com/194466683916784/feed?access_token=AAACTzPZAxblQBAHND7fo1rA58VqQawuJb806Q6BeIFhTroyGSYIe5i0R5fZAZBtffNvkkZB7ayvV7Vw7j7ZBf7vGt6xHx2gjx4FhO8d27sAZDZD
enter your page wall id after .com and in the access token get your own access token from Graph - API explorer
Then exchange that token for a longer for a longer lived one that is for 60 days and you are good to go

Some time ago I had your same problem and I was looking for something very simple to publish feeds of facebook pages, but I didn’t find any solution on the web.
What I want to achieve are the post (only from my personal fan page, not the other) of the bulletin board (facebook wall) of a FB page (this is a fan page, not private profiles) and publish it on my site.
I was hoping to get the posts in JSON or XML format and then encode them so as to use FB as a news system. Unfortunately I haven’t found any kind of solution because I don’t want the user has to log in his account to see something so it must be a flow of pubblic feed.
So, I decided to code the plugin. Here the link to the tutorial:
http://www.lorenzodedonato.com/freebies/facebook-plugin-per-visualizzare-i-post-della-bacheca-di-una-pagina-fan-creato-in-php-json/

Related

Crawl Public Facebook Posts

I made a website where people can post links for other websites and then the backend generates a preview of the link (by using curl and parsing out the open graph tags available on most websites / by picking the first image, html title etc). Now, fine after some tweaking but sometimes I get some kind of rate limit.
Here is one example of a link I want to parse: https://www.facebook.com/HBR/posts/10157131816732787
I can parse it 4 ou 5 times and get a title, image etc but then if I repeat it I get sent to the login page of facebook. How can I avoid this?
I tried to parse the link at https://developers.facebook.com/tools/debug/sharing however it says "Facebook URLs cannot be crawled". So my question is: how am I even supposed to parse those links if they don't even allow it on their debugger?
Is there any kind of API that allows me to get this information without user login? I don't want to parse entire facebook pages, profiles etc, just get a preview for a link that my users might post on the website.
You MUST use the Facebook Graph API if you want to get data of Facebook Pages (or anything else on Facebook), scraping is not allowed.
In order to get data of Pages you do not own, you need to apply for Page Public Content Access: https://developers.facebook.com/docs/apps/review/feature/#reference-PAGES_ACCESS
An App Access Token (without Login) is sufficient in that case.
API Reference for Pages: https://developers.facebook.com/docs/graph-api/reference/page/
I dont think show.You can crawl post on public group using python selenium and beautiful soup

Is there a way to get RSS feed of facebook page?

Problem: I want to display the posts from my facebook page on a PHP page.[When there is a new post on the facebook page, my PHP page should also render the same]
Way1: If there is a way to get a RSS feed of the facebook page i can parse the RSS and display it in the PHP page. But i am not able to find a way to get the RSS feed.
Way2:Another way is to use FB Api. But what API can i use? Never worked with facebook API's so any help would be great.
Any other way to solve the problem is welcome!
Facebook has a universal page RSS feed:
https://facebook.com/feeds/page.php?id=PAGE_ID_HERE&format=rss20
You may simply retrieve and sanitize the data accordingly.
Good luck!
That doesn't seem to work for me (perhaps it's a privacy settings thing?) If you want everything on your wall (not just your own status posts, go to your notifications page and select RSS at the top where you have the options of getting either Text Message alerts or an RSS feed of what's on your wall.
Step 1:
Find your Facebook ID of the page:
http://findmyfacebookid.com/
Step 2:
Add the ID at the end of following url string
http://www.facebook.com/feeds/page.php?format=rss20&id="ADD HERE ID NUMBER ONLY"
e.g.
facebook.com/feeds/page.php?format=rss20&id=100001463662167

Creating a Facebook App

I am building a website for a client. He has a Facebook page for his business. On the homepage of his site, he wants a feed that will pull in all the updates from his business' Facebook page.
Now, I felt this would be very easy to implement (maybe it is) but I have scoured the Facebook API for any simple way to do this. I am having a lot of trouble understanding which way I should do this. I've settled on using JS to access it, but have no idea where to go from there.
Do I need to create an app? If so, which options do I select so I can access the clients facebook page?
How do I get my app that I've created to show up so a user can authorize it? I have so many questions, and Facebook isn't very good at giving me answers.
Any help is greatly appreciated.
I would suggest you just use the facebook page's RSS feed.
Example
Take his page URL e.g.
https://www.facebook.com/pages/Lazery-Attack/6001014870
Take the number at the end of the url off, and plug it into the facebook feeds URL e.g.
https://www.facebook.com/feeds/page.php?format=rss20&id=6001014870
Voila, you now have an RSS feed you can integrate into the website you are building.
URL Breakdown
The URL is broken down the following way:
https://www.facebook.com/feeds/page.php?format={feedFormat}&id={PageID}
Vaid feed formats are:
RSS - rss20
Atom - atom10
JSON - json
Other Examples
Atom
https://www.facebook.com/feeds/page.php?format=atom10&id=6001014870
JSON
https://www.facebook.com/feeds/page.php?format=json&id=6001014870
Take a look at the facebook API, right here: http://developers.facebook.com/docs/reference/api/page/
You can give it a try here:
http://developers.facebook.com/tools/explorer/?method=GET&path=19292868552%2Fposts
The like box: http://developers.facebook.com/docs/reference/plugins/like-box/ also has the latest posts available
The simplest way is to add a Like Button to the page and make sure "show Stream" is checked on as this will show all recent posts. You can customise the appearance also (e.g. width, height etc).
No App or messy API calls needed!
Try it out here and simply paste the resulting code into your webpage:
http://developers.facebook.com/docs/reference/plugins/like-box/
Not an app, but the Facebook Social Plugins over here at Facebook For Pages

How do I post to Facebook a group of Links?

I know how to use Facebook Open Graph to create a wall post on any chosen member, however, I don't know how some applications post something like this:
The 'description' parameter contains 3 different urls. At first I thought they were posting HTML into the 'description' but it turned out Facebook blocks them in the first place.
Is there some hidden undocumented features of the Facebook API they are using? May be the old API had this but the new Open Graph doesnt?
The facebook app:
http://www.facebook.com/apps/application.php?id=20678178440
Facebook Post entity:
http://developers.facebook.com/docs/reference/api/post/
Are you just looking to use HTML? The "default" Wall is plain text. As far as I know you need to install an app to add HTML to your FB wall. Check out the app Advanced Wall to get HTML functionality.

Where is the Facebook Status feed URL these days?

I know that it was previously possible to display your most recent Facebook statuses on your website as an RSS feed, but it seems they've changed their setup and I can't figure out where to find the feed anymore....
I saw some people searching for this a while ago, but since Facebook just released their new layout, I didn't know if this might have changed again.
Any help would be greatly appreciated.
Try this for a feed in JSON-format.
http://graph.facebook.com/[uid]/feed
Facebook appears to have killed all the public status feeds in the name of user privacy. The only way to fetch it is to build a facebook application that gets your status updates, and then associating your facebook account with that application to give it permission to access your status updates so it can put them somewhere else.
Thankfully, someone has already done that for us. Just go to http://apps.facebook.com/statusexport/ while logged in to facebook and grant the app permission. Then it will give you a public URL to an RSS feed of your status updates.
Just keep it simple... This is an easy way to load your latest status(es) using graph.facebook.com through curl / php. Includes a quick simple function.
Easiest way to load your latest facebook status
I found this site which you authenticate, and it will then give you a working rss feed.
I have found that it does have some limitations, but you can see it here:
http://www.fbrss.com
If you wan't to display status updates only, you can use:
https://graph.facebook.com/[uid]/posts
This URL will return a JSON string of user [uid]:s status updates.
To get your status feed, follow these instructions:
Log into Facebook
Go to http://www.facebook.com/notifications.php
Click the link titled "Your Notifications" at the bottom of the box to the right of the list of notifications
That will bring you to a feed of your notifications, which is not what you asked for. This url will be something like feed://www.facebook.com/feeds/notifications.php?id=XXXXXX&viewer= XXXXXX&key=YYYYYYYY&format=rss20
Change notifications.php to status.php in the URL (preserving all the URL parameters).
That should be a feed of your status updates.
Start at http://www.facebook.com/notes.php and click on the "My Friend's Notes" link. Change the friends_notes part of the url to friends_status, and you should be good to go.
Programmatically specifying user to query status updates for
(Note: This is a server-side solution)
It's possible the feed you're looking for has been deprecated for security purposes.
Alternatively facebook FQL on the Status table might provide an answer because it allows you to specify the user ID (for example, your own) for which to retrieve status updates, and a time frame can be specified to limit them as desired.
A raw fb FQL query example, for status updates:
select uid,status_id,message
from status
where uid in
(select uid2 from friend where uid1= uid)
AND time > {time in the last week}
The main FQL guide starts here.
Sample
Poking around the Internet you can pick up sample code of FQL code being called from PHP and other platforms.
PHP example:
<?php
$q = "SELECT name FROM user WHERE uid='$id'";
$query = $facebook->api_client->fql_query($q);
?>
The facebook client API library for your platform of choice can be downloaded and used to issue FQL statements.
--
There is also a Test Console hosted online for facebook developers to test API statements against their own account.
You can also use a RSS feed generator for your Facebook Statuses (or Photos) like the RSS Feeds application on Facebook.
It will help you generate a RSS feed for all your statuses and photos while maintaining the privacy modes.
Although, I am not a fan of the user interface the application has, but the functionality is what is awesome :)
Theres also anther way to do it..Which is simple and easy...its not an rss feed but a plugin can be developed to output as an rss...Theres a tutorial of it on http://Fourgefeed.com