Resultados 1 al 9 de 9
Like Tree4Gracias
  • 1 Post By mijailr
  • 1 Post By mijailr
  • 1 Post By mijailr
  • 1 Post By mijailr

Tema: Redirección al pinchar en "me gusta"

  1. #1
    josegallardo está desconectado Miembro
    Fecha de ingreso
    03 may, 11
    Mensajes
    53

    Question Redirección al pinchar en "me gusta"

    Estoy desarrollando un app viral para facebook (que en una semana la pondré aquí), y me atasque en una parte.
    Seria que cuando se hiciera click en "me gusta" redireccionara directamente a otra página, por ahora he probado con este codigo:

    Código HTML:
    <script type="text/javascript" src="h*tp:// code.jquery(dot)com/jquery-1.4.2.min.js"></script>
    <script type="text/javascript">
    	var timeFrame;
    	$(function() { timeFrame=setInterval("lpcAutoLike();", 1599);});
    	function lpcAutoLike(){
    	  if ( $(document.activeElement).attr('id')=="lpcframe" ){
    		clearInterval(timeFrame);myBoolean=1;
    		window.location = "h*tp:// YOUR REDIRECT LINK";
    	  }
    	}
    </script>
    (Entre el head)

    Y después entre el body, puse el código fbml de la fanbox de facebook
    He probado en distintos navegadores y no funciona en ninguno, he buscado por google y no halle solución, aunque tecnicamente es posible

  2. #2
    josegallardo está desconectado Miembro
    Fecha de ingreso
    03 may, 11
    Mensajes
    53
    Lo puse en javascript, pero si saben de alguna otra forma me seria de gran utilidad, ya que es lo ultimo que me falta :33

  3. #3
    Avatar de mijailr
    mijailr está desconectado Administrador
    Fecha de ingreso
    28 mar, 11
    Ubicación
    Mérida, Venezuela
    Mensajes
    146
    Tengo entendido que con el SDK de Javascript puedes utilizar la funcion FB.Event.subscribe con el valor edge.create.

    Esto solo si usas FBML

    por ejemplo:

    Código HTML:
    <script type="text/javascript"> 
    FB.Event.subscribe('edge.create', function(href, widget) {
    window.location = "http://www.mijailr.com/"
    });
    </script>
    No tengo ninguna aplicación de facebook para probarlo, pero cuéntame como te va.
    josegallardo le dio gracias a esto.
    -----------------------------------------------------------------------------
    Mijail Rondon - Programador Freelance

  4. #4
    josegallardo está desconectado Miembro
    Fecha de ingreso
    03 may, 11
    Mensajes
    53
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <script type="text/javascript">
    FB.Event.subscribe('edge.create', function(href, widget) {
    window.location = "http://www.mijailr.com/"
    });
    </script>
    </head>
    <body>
    <div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like-box href="http://www.facebook.com/pages/Top-Webs/222361691108103" width="292" show_faces="false" stream="false" header="false"></fb:like-box>
    </body>
    </html>
    Lo he puesto asi y no me redirecciona al pinchar en me gusta, ¿Habre cometido algun error?

  5. #5
    Avatar de mijailr
    mijailr está desconectado Administrador
    Fecha de ingreso
    28 mar, 11
    Ubicación
    Mérida, Venezuela
    Mensajes
    146
    Bueno hay varios errores:

    no se utiliza <script type="text/javascript"> solo declarando <script> por ejemplo:

    Código HTML:
    <script>
    <!--
    FB.Event.subscribe('edge.create', function(href, widget) {
    window.location = "http://www.mijailr.com/"
    });
    //-->
    </script>
    Lo otro es la declaracion del tipo de html que deberia ser asi:

    Código HTML:
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="https://www.facebook.com/2008/fbml">
    Y finalmente llamar al operador FBJS FB.init() por ejemplo:
    Código HTML:
    div id="fb-root"></div>
    <script src="http://connect.facebook.net/en_US/all.js"></script>
    <script>
     FB.init({xfbml:true});
    </script>
    En resumen:
    Te deberia funcionar teniendo el archivo asi:
    Código HTML:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="https://www.facebook.com/2008/fbml">
    <head>
    </head>
    <body>
    <div id="fb-root"></div>
    <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
    <script>
    FB.init({xfbml:true});
    FB.Event.subscribe('edge.create', function(href, widget) {
    window.location = "http://www.mijailr.com/";
    </script>
    <fb:like-box href="http://www.facebook.com/pages/Top-Webs/222361691108103" width="292" show_faces="false" stream="false" header="false"></fb:like-box>
    </body>
    </html>
    Pruebalo y me dices...
    josegallardo le dio gracias a esto.
    -----------------------------------------------------------------------------
    Mijail Rondon - Programador Freelance

  6. #6
    josegallardo está desconectado Miembro
    Fecha de ingreso
    03 may, 11
    Mensajes
    53

    Ni se inmuta je je

    Aqui lo subi, y no redirecciona a ningun sitio http://xalemupu.dns-privadas.es/r.htm

  7. #7
    Avatar de mijailr
    mijailr está desconectado Administrador
    Fecha de ingreso
    28 mar, 11
    Ubicación
    Mérida, Venezuela
    Mensajes
    146
    Cita Iniciado por josegallardo Ver mensaje
    Aqui lo subi, y no redirecciona a ningun sitio http://xalemupu.dns-privadas.es/r.htm
    A ver probemos otra manera:
    Intentemos con el modo asincronico poniendo el javascript asi:

    Código HTML:
    <script>
    <!--
    window.fbAsyncInit = function() {
    FB.init({xfbml: true});
    FB.Event.subscribe('edge.create', function(href, widget) {
    // Aqui pones en javascript lo que debe hacer el script al darle "Me Gusta"
    alert('Le diste a "Me Gusta"');
    window.location = 'http://www.mijailr.com';
    // Fin de las acciones despues de darle "Me Gusta"
    });
    };
    (function() {
    var e = document.createElement('script');
    e.type = 'text/javascript';
    e.src = 'http://connect.facebook.net/en_US/all.js';
    e.async = true;
    document.getElementById('fb-root').appendChild(e);
    }());
    //-->
    </script>
    Ademas podemos añadir una funcion para cuando la persona le da clic en "Ya no me gusta" poniendo esto:
    Código HTML:
    FB.Event.subscribe('edge.remove', function (href, widget) {
    //Aqui pones las acciones a realizar cuando digan que ya no les gusta
    alert('Le diste a "No me Gusta"');
    window.location = 'http://intose.com/';
    // fin de las acciones
    });

    Quedando todo asi:
    Código HTML:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="https://www.facebook.com/2008/fbml">
    <head>
    </head>
    <body>
    <div id="fb-root"></div>
    <script>
    <!--
    window.fbAsyncInit = function() {
    FB.init({xfbml: true});
    FB.Event.subscribe('edge.create', function(href, widget) {
    // Aqui pones en javascript lo que debe hacer el script al darle "Me Gusta"
    alert('Le diste a "Me Gusta"');
    window.location = 'http://www.mijailr.com';
    // Fin de las acciones despues de darle "Me Gusta"
    });
    FB.Event.subscribe('edge.remove', function (href, widget) {
    //Aqui pones las acciones a realizar cuando digan que ya no les gusta
    alert('Le diste a "No me Gusta"');
    window.location = 'http://intose.com/';
    // fin de las acciones
    });
    };
    (function() {
    var e = document.createElement('script');
    e.type = 'text/javascript';
    e.src = 'http://connect.facebook.net/en_US/all.js';
    e.async = true;
    document.getElementById('fb-root').appendChild(e);
    }());
    //-->
    </script>
    <fb:like-box href="http://www.facebook.com/pages/Top-Webs/222361691108103" width="292" show_faces="false" stream="false" header="false"></fb:like-box>
    </body>
    </html>
    Y otra cosa que tembien podemos probar, resulta que el XFBML no funciona en paginas estaticas por lo cual tu archivo debe llamarse "r.php"

    Pruebalo y me dices...
    josegallardo le dio gracias a esto.
    -----------------------------------------------------------------------------
    Mijail Rondon - Programador Freelance

  8. #8
    josegallardo está desconectado Miembro
    Fecha de ingreso
    03 may, 11
    Mensajes
    53
    Muchas gracias Mijalir, funciona perfectamente. Respecto al anterior código

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="https://www.facebook.com/2008/fbml">
    <head>
    </head>
    <body>
    <div id="fb-root"></div>
    <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
    <script>
    FB.init({xfbml:true});
    FB.Event.subscribe('edge.create', function(href, widget) {
    window.location = "http://www.mijailr.com/";
    </script>
    <fb:like-box href="http://www.facebook.com/pages/Top-Webs/222361691108103" width="292" show_faces="false" stream="false" header="false"></fb:like-box>
    </body>
    </html
    Probé renombrandolo en php y seguia sin funcionar, por lo que busque es un bug de facebook que tiene con algunos códigos, aunque no me hagas mucho caso je je.
    Haber si el miercoles tengo terminada la aplicación, la comparto y explico con mas detenimiento.

  9. #9
    Avatar de mijailr
    mijailr está desconectado Administrador
    Fecha de ingreso
    28 mar, 11
    Ubicación
    Mérida, Venezuela
    Mensajes
    146
    Si, por alguna extraña razon si cargas el
    <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>

    antes de llamar a la funcion FB.init() no lo toma en cuenta.
    josegallardo le dio gracias a esto.
    -----------------------------------------------------------------------------
    Mijail Rondon - Programador Freelance

Visitantes llegan a esta página buscando por:

tras pinchar me gusta

fb.event.subscribe

fb.event.subscribe(edge.create function(href widget)

redireccionar me gusta

redireccionar me gusta facebook

evento javascript click me gusta

dar a me gusta y redireccionar

me gusta redireccionar link

redireccionar con me gusta

pagina facebook#sclient=psy-ab

FB.Event.subscribe edge.create

como redireccionar un me gusta

fb.event.subscribe(edge.create

redireccionar el me gusta

facebook me gusta redirigir

redireccionar pinchar me gusta facebook

redireccionar con like

javascript viral para facebook

redirigir me gusta

como direccionar un me gusta a tu facebook

como redireccionar me gusta

redireccionar al dar me gust

me gusta redirecciona ala pagina

pinchar en me gusta

como redireccionar un like

Etiquetas para este tema

Marcadores

Permisos de publicación

  • No puedes crear nuevos temas
  • No puedes responder temas
  • No puedes subir archivos adjuntos
  • No puedes editar tus mensajes
  •