@mrjyn
September 18, 2010
Facebook is hard to 'LIKE' but this guy makes it easier
Some days ago facebook released their new graph api system to develop social sites more easily. Its really cool and I personally like the facebook's new graph api system. Facebook also updated their old facebook connect system and provided better way to integrate facebook connect feature, user authentication and calling facebook api from website.
In this article, I'll highlight javascript base
- Facebook connect authentication for websites
- How to use graph api
- How to show stream publish prompt and share prompt
- How to run FQL query using javascript
- How to set status using old legacy api calling by javascript
Here is the demo http://thinkdiff.net/demo/newfbconnect1/newconnect.php
1. Facebook connect authenticationFirstly you've to setup a facebook application to get the application id. You can setup application from here. Or if you have already setup a facebook application then just copy the application id and replace with xxxxxxxxxxx.
01 | <div id="fb-root"></div> |
02 | <script type="text/javascript"> |
03 | window.fbAsyncInit = function() { |
04 | FB.init({appId: 'xxxxxxxxxxxxxx', status: true, cookie: true, xfbml: true}); |
05 | }; |
06 | (function() { |
07 | var e = document.createElement('script'); |
08 | e.type = 'text/javascript'; |
09 | e.src = document.location.protocol + |
10 | '//connect.facebook.net/en_US/all.js'; |
11 | e.async = true; |
12 | document.getElementById('fb-root').appendChild(e); |
13 | }()); |
Just put this code in your html file after the body tag. This is the most efficient way to load the javascript SDK in your site. And in this way the sdk will load asynchronously so it does not block loading other elements of your page. Details of FB.init method.
And your html tag should be
1 | <!DOCTYPE html> |
2 | <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> |
Now we will use another method FB.Event.subscribe so that we can subscribe some events like login, logout, sessionChange. So modify the window.fbAsynInit and update by below code
01 | window.fbAsyncInit = function() { |
02 | FB.init({appId: 'xxxxxxxxxxx', status: true, cookie: true, xfbml: true}); |
03 |
04 | /* All the events registered */ |
05 | FB.Event.subscribe('auth.login', function(response) { |
06 | // do something with response |
07 | login(); |
08 | }); |
09 | FB.Event.subscribe('auth.logout', function(response) { |
10 | // do something with response |
11 | logout(); |
12 | }); |
13 |
14 | FB.getLoginStatus(function(response) { |
15 | if (response.session) { |
16 | // logged in and connected user, someone you know |
17 | login(); |
18 | } |
19 | }); |
20 | }; |
BUSTING OUT (1987) VintageSleaze.com: Parliament Magazine
Google Alert - whatgetsmehot.posterous.com VideoWap.Tv
Web 2 new results for
whatgetsmehot.posterous.com South African symbol made in China youtube.com China's football team never made it to the World Cup, ...w.videowap.tv/youweirdtube/
- vigrxbuy.posterous.com - Free Reverse IP Lookup. DNS tool.Check ...
vigrxbuy.posterous.com - Free Reverse IP Lookup. DNS tool.Check all domains hosted on ... comicbookcartography.posterous.com ...
Po recommended
whatgetsmehot.posterous.com ...
www.thegetpr.net/reverseip/vigrxbuy.posterous.com
Tip: Use a minus sign (-) in front of terms in your query that you want to exclude. Learn more.
Wikimedia Commons page Category:Fisting has been changed by Cathy Richards
Wikimedia Commons page Category:Fisting has been changed by Cathy Richards
The Wikimedia Commons page
- Dear Mrjyn,
- Category:Fisting
has been changed on
18 September 2010 by Cathy Richards, see
revision.
- for the current
- See
- http://commons.wikimedia.org/w/index.php?title=Category:Fisting&diff=0&oldid=33544706
- for all changes since your last visit.
Editor's summary: template Contact the editor:
mail:
http://commons.wikimedia.org/wiki/Special:EmailUser/Cathy_Richards
There will be no other notifications in case of further changes unless
you visit this page.on your watchlist.
- You could also reset the notification flags for all your watched pages
- Your friendly Wikimedia Commons notification system