Facebook graph api feed and home give old data - facebook

when I using facebook graph api explorer for feed and home data,it always gives old result.
Generally me/home gives recent friends activity which show as like as when facebook.com open and feed gives if someone tag me,or comment my status releted to me.but when I compare with my feed wall with data given by grap api me/feed or me/home its show that graph api response is not updated. I can't use real time update its only because real time update does not support native desktop application.
so is there any other way to get recent update of recent activites except me/home and me/feed method?

I think you should consider using real time update. The fact that it doesn't support native desktop application isn't a real problem. It just means that you have to do some alternations in your application.
I don't know what OS you are using or what programming language you are using, but I think it's rather safe to say that your toolbox when it comes to your technologies can support calls to a web server or a web service.
Then you should use the web server or web service to implement the real time update specifications given by Facebook.
Alternative, you call poll Facebook API on a regular basis but I would not recommend it.
Use real time update and check your web server for new messages. This solution is working quite good. I have received updates from Facebook within 10 seconds after they have been posted.
If you don't want to poll your web server, try to implement it using web sockets (HTML5), perhaps in combination with node.js.

Related

Sending Facebook app request using Tornado Framework

I am a student majoring in CS and very newbie to Facebook app development. I couldn't find any good resources online so, I was wondering how can I send an app request or a message using python tornado framework to targeted user? So far, I have my app access token but I couldn't get app request to work... I need some kind of reference to follow but I am not having good time finding one that is "SIMPLE" enough... Thanks!
Regardless of the backend framework, doing app invites is all client-side, so as long as you can stream out HTML from your server with the correct Javascript, then you'll be well on your way.
See: http://developers.facebook.com/docs/reference/dialogs/requests/ For information and examples can be found and played with in Javascript tool at: http://developers.facebook.com/tools/console/ click Examples, then click apprequests

Where to begin with using Facebook's PHP SDK to create events?

I want to use Facebook's PHP SDK to create/update/cancel events on our Facebook Page, whenever they are added/modified/deleted within the "calendar of events" database table on our web site.
Where do I even begin with this? I have the SDK installed, but I am having a really hard time figuring out how to register my own custom app and install it to my Facebook user account. I did manage to get an App ID and App Secret, and I also created a minimal canvas and indicated which persmissions the app needs. But, for the life of me I can't figure out how to install the app on my FB user account.
I don't want to make the app available to others, and I don't even want to access it while I'm logged into Facebook. I just want to be able to do something like $fbapi->createEvent() within my own code on my own site.
Also, do I need to have an authenticated Facebook user session/cookie when calling the API to create the event? It seems to me that would eliminate the possibility of creating events via a command-line PHP cron job.
I feel like I am understanding bits and pieces of this, but there are gaps in my understanding and I'm not seeing how all the pieces fit together. Any direction would be immensely appreciated!
First play around with the Graph API Explorer https://developers.facebook.com/tools/explorer so you can understand better how the Graph is used. From there you can then learn about the PHP SDK http://developers.facebook.com/docs/reference/php and how to do the same things you did with the explorer tool. Events are here documented here: http://developers.facebook.com/docs/reference/api/event/

Canvas app using the FaceBook 3.1 API?

I used to develop a few FB apps in the past (using the old rest-ased api), and now I'm considering to make them actually usable again by porting them to the new 3.1 API.
Sounds nice, but for some reason this is way harder than I should be...
So here are few questions:
Is there any example of a canvas app using the 3.1 API? Google did not give me anything useful
Is there still a difference between iframe and FMBL canvas applications? In my app settings, I checked the fmbl-option, but when I'm back at the app overview page, it still says it's an iframe app.
The SDK mentions the getUser() function to get the user-id, but how do I request the necessary permissions for my app? When I do some googling, I find even another solution which calls a specific url and then performs a callback. This solution however doesn't seem to php sdk at all!
Where is the documentation of the php-api? The only usable thing I find is this: https://github.com/facebook/php-sdk which consists only a few lines of code. And I suspect this is for having a fb login-button on your own website, not for a canvas app.
Firstly, good luck, and best wishes - you'll need it. Maintaining Facebook apps is way harder than it should be, because Facebook doesn't believe in legacy support, changes things all the time, and deprecates things quickly and completely. As a (former) Facebook app dev myself, I can tell you there is only one constant: apps will die if you leave them alone. As an app developer, Facebook owes you no favors, and it is vicious when it comes to breaking apps.
As for specifics: as of June 2012, Facebook has deprecated and removed FBML and the REST API, and there is no longer any difference between canvas apps and iFrame apps. This isn't a soft, "you shouldn't use it" deprecation - it's a hard, "your apps are now broken" deprecation. All apps are now iFrame apps, as there is no longer any other way to build them. The docs on how to build a canvas/iFrame app are here, and there's an auth migration guide that may be helpful in conversion. Oh, and you'll need to get your app running on HTTPS too, if you haven't already.
As for the rest of it, it sucks, but the only way you're really going to be able to maintain and get your application working is using the Open Graph API. Using the PHP SDK, you just run $facebook->api('/graph/url/here') - for instance, to get user information, run $facebook->api("/$userid"). You get the URLs off of the Open Graph docs - just grab everything after the graph.facebook.com bit and pass it to api(). It's another learning curve, and (depending on the complexity/modularity of your code) is anywhere from a lot to a nightmarish mountain of changes, and there are no drop-in replacements. Sometimes you can use the old REST api, but I doubt that will last very much longer either. It's painful, but that's how it goes. You're at the mercy of Facebook, because it's their data.
Upgrading apps involves a shift in thinking: apps are now literally just webpages surrounded by the Facebook chrome. There is now no difference between an external website that uses Facebook's api to pull in information and an app that runs inside of Facebook. It's for that reason, personally, that I've shifted to just that for my own app - an external website that just happens to use Facebook for most of its posting/sharing/user info needs.
For authorization, you request permissions via OAuth, using any number of methods. There are docs on how to do that over on Facebook as well. Specifically for the PHP api, you generate a URL using getLoginURL() and then redirect to it. Facebook eventually redirects back to a URL you specify with info about whether they authorized your app and such, after which you can do a getUser(). If you want fancy/slick/user-friendly popup dialogs without a bunch of redirecting, the Javascript SDK is your friend.

How to go about building an iPhone app that accesses a website with a custom UI?

I don't quite know how to explain this but I want to build an app that can access a website like, for example, Facebook, but I don't actually want it to be Facebook's website in the sense that I want to design the UI. There is a couple of apps like this already in the app store, one being called "Facebook Touch HD". I have managed to get an app to access Facebook with UIWebView, but it just goes to Facebook's mobile website, obviously.
Look at the Facebook IOS SDK.
You probably want to fetch data from Facebook using its APIs. Facebook actually offers a library for iOS, so you may want to check it out.
In general, this applies to any site that offers an API. Usually you can use NSURLConnection to make requests to get the data you're interested in (check the specific API's documentation for details); then you have parse that data (most services output data in XML or JSON).

Aggregating and displaying facebook and twitter status updates on Coldfusion Page

As an experiment I'd like to set up a coldfusion page that will pull and display the status updates from my own facebook account and twitter accounts that fall within an input date range; similar to tools like
http://orsiso.com/
http://www.threadsy.com/
and http://www.davidcramer.net/lifestream
I assume this will involve working with the facebook and twitter apis, which I have some experience with when working with mobile apps; but I've never tried to do something like this with a coldfusion page before. Eventually I'd like to pull other things like images and such, but for a first test just status updates is fine. Does anyone have sample code and/or pointers that could assist me in this endeavor? Thank you very much in advance.
Edit: I'm interested in a variant of this idea involving a database, and I've opened up a new question regarding such: Pulling facebook and twitter status updates into a SQL database via Coldfusion Page
In addition, you should check out RIAForge, which has CF code to handle both Twitter and Facebook APIs.
For Twitter see this..
http://www.stephenwithington.com/blog/index.cfm/2009/3/4/Use-ColdFusions-CFFeed-to-Display-Your-Twitter-Tweets-and-more-on-Your-Blog-in-30-Seconds
Have a look at this coldfusion wrapper for the twitter API here, really easy to set up and grab the data from your twitter feed.
I also use the twitter4j library to access my twitter account on my coldfusion site, I followed the tutorial here to get started.