-
Notifications
You must be signed in to change notification settings - Fork 0
/
xfbml.html
94 lines (87 loc) · 4.16 KB
/
xfbml.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#" xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Facebook JavaScript & OAuth 2.0 xfbml Demo</title>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-26316345-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www')
+ '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function(){
FB.init({ appId: '211488312251165',
status: true,
cookie: true,
xfbml: true,
oauth: true});
// friends
var friendsDiv = document.getElementById('friends_profile_pics');
FB.getLoginStatus(function(response) {
if (response.status != 'connected') {
friendsDiv.innerHTML = '<em>You are not connected</em>';
return;
}
FB.api({ method: 'friends.get' }, function(result) {
var markup = '';
var numFriends = result ? Math.min(10, result.length) : 0;
if (numFriends > 0) {
for (var i=0; i<numFriends; i++) {
markup += ('<fb:profile-pic size="square" ' +
'uid="' + result[i] + '" ' +
'facebook-logo="true"' +
'></fb:profile-pic>');
}
}
friendsDiv.innerHTML = markup;
FB.XFBML.parse(friendsDiv);
});
});
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.async = true;
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
<div><a href="/">BACK HOME</a></div>
<h3>Facebook JavaScript & OAuth 2.0 xfbml Demo</h3>
<br/>
<fb:like send="true" width="450" show_faces="true"></fb:like>
<br/>
<fb:share-button href="http://facebook-javascript-api.appspot.com/xfbml.html" type="button_count"></fb:share-button>
<br/>
<div id="friends_profile_pics"></div>
<br/>
<fb:login-button autologoutlink="true" scope="email,user_birthday,status_update,publish_stream"></fb:login-button>
<br/>
<div><a href="invite.html">Invite My Friends</a></div>
<p></p>
<fb:activity site="facebook-javascript-api.appspot.com" width="300" height="300" header="true" recommendations="false"></fb:activity>
<p></p>
<fb:comments href="http://facebook-javascript-api.appspot.com/xfbml.html" num_posts="5" width="500"></fb:comments>
<br/>
<p></p>
<fb:like-box profile-id="211488312251165" width="292" show_faces="true" stream="false" header="true"></fb:like-box>
<p></p>
<fb:fan profile-id="211488312251165"></fb:fan>
<p></p>
<fb:live-stream event_app_id="211488312251165" width="400" height="500" always_post_to_friends="true"></fb:live-stream>
<p></p>
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
{lang: 'zh-CN'}
</script>
<g:plusone size="tall"></g:plusone>
</body>
</html>