How can I implement Facebook Chat on my site? - facebook

I'm developing a site with something similar to the Digg bar at the top. One of the features requested is a live chat using Facebook. Is it even possible to implement Facebook Chat on my site by using Facebook Connect or other methods? And if so, how?
[update] I've seen that it works with Pidgin and Adium, but what I'm looking for is a site based implementation (think AJAX & HTML living at the top of the page).

It appears that the Facebook team has at least begun, if not finished, implementing an xmpp/jabber interface for Facebook Chat. This would allow you to use any XMPP enabled client to connect to Facebook. That said, there's at least one javascript jabber client library available that I can find. Although, you may have to implement a proxy on your web server to allow the JS client to talk to the Facebook server.
Also, I'm not sure how they're doing it, but Meebo has managed to enable Facebook chat integration on their site with Facebook Connect. I haven't found anything mentioning it, but this functionality may be easily available through the Facebook Connect API (documentation).
To answer your question: Yes, it's possible.

Related

Hooking any AI chatbot to Facebook chat

I haven't tried anything on this, but is it possible? If it is, is there a way of making a plugin for firefox or chrome? or making a software that enables you to hook ai chatbot to Facebook chat. I really want to use cleverbot or iGod.
You can connect to the facebook chat via the XMPP API, though I believe using it to connect a bot or anything that is not user-to-user chat is a violation of the rules.
There are many services such as Kommunicate and ManyChat, that provides a way to automate facebook conversations using AI Chatbot.
Signup at Kommunicate, visit Integrations section. Select Facebook, then select the Facebook page and connect. After that, go to Bot Integration section and connect it with the bot.
Here is a detailed instructions on th same: https://www.kommunicate.io/blog/facebook-chatbot/

Applications inside my Web application

Currently we are developing social network, which includes apps inside, for example Games. There is no public API for developers to make their apps, instead Apps developed ourself.
Our platform is based on Zend Framework. Also we have XMPP protocol implementation (clientside-strophe, serverside-java) for chat, notifications and for other pushing tasks. XMPP will be used in apps.
We want to separate apps from social network code, so we can keep it simple, lightweight.
What strategy you can suggest for such separation? Our desire is to keep architecture and code simple and clean.
Since this is an architectural question, I'm sure there are many way of doing what you need. Here is my 2 cents. Keep your apps server completely separated from the social media server. Use client side JS scripts to embed and render the apps on your social media site.
Think it like this: You know Facebook social plugins that allow embedding Facebook components in external sites. Below is a screenshot of Facebook LikeBox embedded in a completely separate DNN portal.
In your scenario, assume DNN as your social media site. And the LikeBox as your app. Architecturally they are well separated, even can be served from different severs. But integration happens on the client side.
If you need these apps to interact with the social media site, either you can do it via a REST API. Or you can use DOM events or simple JS function calls.
Few days ago I wrote a blog post on a similar architecture and can be found at: http://blog.hasith.net/2012/06/traditional-portals-are-dead-long-live.html
3rd party apps like facebook app are standalone application which access facebook DATA .
So make your social network data available through your API on internet, implement Zend_OAuth for authentication HMAC after that you can freeze your social network code .
Now you can create your web application in Javascript/Flash which access your social network data through your API .

how to make facebook chat?

I want to create an android Facebook chat application , i found this open source project ..
http://coderrr.wordpress.com/2008/05/06/facebook-chat-api/
but i want to ask whether this "Facebook chat api" is still working ?
If no, what is the way to creat a facebook chat ?
Dig a bit deeper into http://developers.facebook.com/docs/chat/. There are a number of XMPP and related APIs for Java, C#, iOS, and Android alike to be found on the web - or you can base such work on the libpurple API from Pidgin (http://www.pidgin.im/). It would behoove you to become familiar with XMPP concepts.
There is great simple code https://github.com/KanybekMomukeyev/FacebookChat , i used it in my app.
Facebook provides their own chat API. See the docs at Integrating with Facebook Chat. They provide sample code in PHP.
You can also use Jabber to authenticate with Facebook. You'll need an application key to ensure this all works.
U can integrate fb chat using facebook authentication or by digest md5...the code given there does not use any API keys nor it uses digest md5 authentication... So not sure whether it ll wrk...try it out... the overall architecture would be
app<->xmpp<->BOSH<->Facebook chat
Since fb support xmpp protocol u can set an xmpp chat client using lib lik smack,strophe,asmack etc...
refer to http://professionalxmpp.com/..great to start with..gives complete idea on hw to go abt...

Facebook Open Graph without a browser

For a middleware system with internet (which works inside a set-top box) I want to develop a primitive Facebook interface where users can type their user-names and password, showing their latest notification, messages and other casual stuff on the TV screen by using the recent Facebook Graph API.
This middleware program uses Java ME to run programs (such as this simple facebook app) and it can connect to internet however it doesn't have a real web browser. Without browser it can connect to any url to retrieve the JSON response however I am not sure how to achieve authentication without a real browser.
Under this circumstances, is it possible Facebook authentication? If you think so, what approach would you suggest ?
Thanks
Facebook provides trusted partners with a private Authorization API to get an OAuth 2 token from a username / password.
A more complicated approach would be doing something similar to how Netflix enrolls a device:
device calls server to obtain a Code
device shows code on screen and directs user to go to URL on server and enter Code
server redirects user to Facebook and obtains OAuth token, user told to go back to device
device calls server with Code and obtains OAuth token
device can now make calls directly on behalf of user
According to this documentation on "Desktop Application Authentication" I don't believe your desired result is possible:
Facebook's OAuth implementation does not include explicit desktop application support. However, if your desktop application can embed a Web browser, you can add Facebook support to your application easily using the same OAuth User-Agent Flow used by JavaScript clients.
However, it is clearly possible for certain vendors to do this, since Microsoft's Xbox 360 Facebook application does exactly what you are proposing. I'd be interested to see if anyone has dug up any API for doing this that Facebook doesn't want in their most obvious documentation.
This isn't an answer but I'm trying to do the same thing. Check out this guy's blog which uses another server to proxy the requests:
cory wiles blog
If you figure it out please post a detailed answer here so I can do it to.. :)
I think it is possible though it is pretty complicated and subject to sudden changes of Facebook interface. It might break the agreement between you and Facebook.
What you do is to emulate the Facebook.
One path you have to set up a Facebook application. Once you got the authorisation from user, you can to something with Graph API.
You need to the Facebook log-in process and authorisation process. There are some capturing tools on http/https request and response. Analyse them, both header and body.
Once you know the authorisation mechanism, you can replace it with you own. Everything afterward is on Graph API.
Another path is to emulate Facebook login and message and notification process. Capturing and analysis is needed.
In the past I have used a tool called screen-scraper (full disclosure: I used to work there) to automate logging in to facebook. Basically, it imitates a browser session; it allows you to set session variables (i.e. username, password) which would then be submitted to facebook, just as if the user had submitted them in a browser.
You may not be able to use screen-scraper in your set-top box environment (although it is java-based, so it's possible it would work). Even if it doesn't, you could implement a similar strategy in java, making the HTTP calls a browser would make to load the login page and submit the user's credentials. To keep the user's info safe make sure whatever HTTP client library you use supports HTTPS.
Proxy tools and extensions like Charles, Fiddler2, Firebug, Chrome's dev tools, etc. are helpful in seeing exactly what the browser is sending to the server in requests.

Facebook App vs. Facebook Connect site

I'm reading Facebook's documentation so I can figure out how to enable Facebook Connect on my site. What confuses me is which parts apply to Facebook applications and Facebook Connect, because I'll be reading along, thinking I'm learning about Facebook Connect, but then I'll reach a section that mentions Facebook applications. For example, here's an except from the page on Data.getCookies:
This method returns all cookies for a given user and application.
Cookies only apply to Web applications; they do not apply to desktop applications.
I think of my website as a Web application, but I can't tell if "Web applications" simultaneously refers to Facebook Connect sites and Facebook applications. How can I tell if what I'm reading applies to Facebook Connect and not just Facebook apps?
In that context, "Web applications" refers to canvas based apps with Facebook. "Desktop apps" is the other type mentioned there, and refers to a non-web app like a widget for your system tray in Windows.
I would look at the Facebook platform as a set of APIs:
Facebook canvas applications (Apps you use in FB. What users think of as "Facebook apps")
FBML / FBJS apps
Iframe canvas apps
Facebook desktop applications (Rare)
Facebook connect applications (Websites with elements of FB in them. CNN, Digg)
Web
iPhone
Note that all of these can access the Facebook API, the REST and FQL interface. Most of the documentation is for FBML canvas applications. On the left side of the Facebook developer wiki you can see a few top-level options:
API (you can always use this)
FBML (canvas apps only)
XFBML (Facebook connect only)
FQL (you can always use this)
FBJS (mostly canvas apps, some connect functionality)
I'm sure you've seen:
http://wiki.developers.facebook.com/index.php/Facebook_Connect
Which is the main connect documentation. I hope this helps you get organized.
Good luck!
Many aspects of the FB web applications (like FBML, FQL) are common for both FB apps and FB Connect. I would say that FB Connect is more likely to be used on sites implementing more FB's visual elements (FBML). Additionally, FB Connect can be used off-line (where the user does not have a current session directly with FB).
I admit that the documentation is fairly scattered and often quite vague - but once you keep reading more and more about it, the concepts become clearer. At least that was my experience.
I recently found a great blog post that describes the differences between FBML canvas pages, iframe canvas pages and Facebook Connect sites. It focuses more on the technical difference between FBML and iframe apps, but since these technologies are mentioned throughout Facebook's documentation, it seems almost essential for Facebook Connect developers to have a basic understanding of regular Facebook apps, even though they won't be working with them directly. I think knowing about this page a few months ago would have saved me alot of heartache.