<html>
<head>
<title> Bienvenue! </title>
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src = "http://connect.Facebook.net/fr_FR/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'Facebook-jssdk'));
</script>
</head>
...
</html>
...
</script>
</head>
<body>
<div id="fb-root"></div>
<div class="fb-like"
data-href="http://www.insa-lyon.fr/"
data-send="false"
data-layout="button_count"
data-width="20"
data-show-faces="true"></div>
</body>
</html>
In Action<html>
<head>
<title> Bienvenue! </title>
</head>
<body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '140004429471204', // App ID
channelUrl : '//tc-net2.insa-lyon.fr/fb/channel.html',
status : true, // check login status
cookie : true, // enable cookies to allow session
xfbml : true // parse XFBML
});
FB.getLoginStatus(function(response) {
FB.api('/me', function(user) {
var image = document.getElementById('image');
image.src = 'https://graph.Facebook.com/' + user.id + '/picture';
var name = document.getElementById('name');
name.innerHTML = user.name
});
}, true);
};
(function(d) {
var js, id = 'Facebook-jssdk', fjs = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) return;
js = d.createElement('script'); js.id = id;
js.src = "http://connect.Facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document));
</script>
<div class="fb-login-button" scope="user_birthday" autologoutlink="true"></div>
<div align="center">
<img id="image"/>
<div id="name"> </div>
</div>
</body>
</html>
In Action
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.Facebook.net/fr_FR/all.js#xfbml=1&appId=142947120";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'Facebook-jssdk'));</script>
<fb:registration
fields="[
{'name':'name'},
{'name':'email'},
{'name':'birthday'},
{'name':'noEtudiant','description':'Numéro d\'étudiant','type':'text'}
]"
redirect-uri="https://tc-net2.insa-lyon.fr/"
width="530">
</fb:registration>
</body>
</html>
In Action
Graph : Base de données Facebook Open : Extension proposées par une application et validées
Contrainte : l'action doit être publique.
<html>
<head prefix="og: http://ogp.me/ns#
fb: http://ogp.me/ns/fb#
insatelecom: http://ogp.me/ns/fb/insatelecom#">
<meta property="fb:app_id" content="121204"/>
<meta property="og:type" content="insatelecom:lecture"/>
<meta property="og:url" content="http://tc-net2.insa-lyon.fr/aff/fb/test-2.html"/>
<meta property="og:title" content="Sample 2"/>
<meta property="og:image" content="https://devsite/attachment_blank.png"/>
</head
<body>
<embed src="http://tc-net2.insa-lyon.fr/aff/fb/ects-jav.pdf"
width="700px"
height="800px"\>
</body>
</html>
Stéphane a suivi MID
<html>
<head prefix="og: http://ogp.me/ns# insatelecom: http://ogp.me/ns/apps/insatelecom#">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Bienvenue sur Télécom</title>
<script type="text/javascript">
function generateCV() {
FB.api('/me/insatelecom:follow',
'post',
{ lecture: 'http://tc-net2.insa-lyon.fr/aff/fb/test-2.html' });
}
</script>
</head>
<body>
<div id="fb-root"></div>
<script>
(function(d){
var js, id = 'Facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.Facebook.net/en_US/all.js#xfbml=1&appId=140004429471204";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
</script>
Voulez-vous valider votre cv télécom ?
<form> <input type="button" value="JAV" onclick="generateCV()" /> </form>
</body>
</html>