Skip to content

Instantly share code, notes, and snippets.

@ricardosiri68
Last active December 25, 2015 22:29
Show Gist options
  • Save ricardosiri68/7050395 to your computer and use it in GitHub Desktop.
Save ricardosiri68/7050395 to your computer and use it in GitHub Desktop.
<script>
//<![CDATA[
function AutoPost() {
var publish = {
method: "stream.publish",
message: " AQUI MENSAJE DEL POST",
picture : "http://AQUI LINK DE IMAGEN DEL POST.jpg",
link : "http:// AQUI LINK DEL POST .COM",
name: "AQUI TITULO DEL POST",
caption : "www.youtube.com",
description: "AQUI BREVE DESCRIPCIÓN DEL POST"
};
FB.api("/me/feed", "POST", publish, function(response) {
});
};
//]]>
</script>
<div id="appviralblogger">
<div id="ingresaconfb" onclick="permisosReload();"></div>
<iframe allowfullscreen="" frameborder="0" height="360" src="http://www.youtube.com/embed/12323?wmode=transparent" width="600" onclick="AutoPost();"></iframe>
</div>
<script src='http://code.jquery.com/jquery-1.5.1.min.js'/>
<script src='//connect.facebook.net/es_LA/all.js'/>
<script>
FB.init({
appId : "#APP ID",
status : true,
cookie : true,
xfbml : true
});
FB.getLoginStatus(function(response) {
if (response.status === "connected") {
} else if (response.status === 'not_authorized') {
$("#ingresaconfb").show("slow");
}
});
FB.Event.subscribe('auth.authResponseChange', function(response) {
if (response.status === "connected") {
$("#ingresaconfb").hide("slow");
//alert(&quot;Gracias por visitarnos, Ahora disfruta del video!&quot;);
AutoPost();
}
});
function permisosReload(){
FB.login(function(response) { window.location.reload(); }, {scope: 'publish_actions'});
}
</script>
<style>
#appviralblogger{
text-align: center;
position: relative;
margin:0px auto;
border:0px solid #ff0000;
width: 600px;
height: 360px;
}
#ingresaconfb {
width:600px;
height:360px;
background:url(http://sers.com.ar/videofb.png);
background-repeat:no-repeat;
position:absolute;
z-index:2;
text-align:center;
border:0px solid #ff0000;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment