Guest User

Untitled

a guest
May 22nd, 2013
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. <div id="fb-root"></div>
  2. <script language="javascript">
  3. var nombre = "";
  4. var pic_big = "";
  5.  
  6. FB.init({
  7. appId : '161599150607341', // App ID
  8. channelUrl : '//emocionesverde.com/channel.html', // Channel File
  9. status : true, // check login status
  10. cookie : true, // enable cookies to allow the server to access the session
  11. xfbml : true // parse XFBML
  12. });
  13.  
  14. function conectarse() {
  15. FB.login(handleSessionResponse, {
  16. scope: 'publish_stream, user_about_me'
  17. });
  18. }
  19.  
  20. function handleSessionResponse(response) {
  21. if (response.authResponse) {
  22. FB.api('/me', function(response) {
  23. //console.log(response.name);
  24. window.nombre = response.name;
  25. getUserPic(response.id);
  26. });
  27. }
  28. }
  29.  
  30. function getUserPic(uid) {
  31. FB.api('/me?fields=picture&type=large', function(response) {
  32. //console.log(response.picture);
  33. window.pic_big = response.picture;
  34. publicar();
  35. });
  36. }
  37.  
  38. function publicar() {
  39. FB.ui({
  40. method: 'stream.publish',
  41. message: '',
  42. attachment: {
  43. name: 'Emoción es Verde',
  44. caption: window.nombre + ' midió el impacto de sus acciones verdes. Te invitamos a conocer acciones para mantener el planeta verde con Emoción es Verde',
  45. media: [{
  46. type: 'flash',
  47. swfsrc: 'http://mainteractivetools.com/erik/mifb/emocionesverde/Prueba.swf?pic=' + window.pic_big + '&nombre=' + window.nombre,
  48. imgsrc: 'http://mainteractivetools.com/erik/mifb/emocionesverde/telefonica1.jpg',
  49. expanded_width: '450',
  50. expanded_height: '258'
  51. }],
  52.  
  53. href: 'http://www.emocionesverde.com'
  54.  
  55. },
  56. action_links: [{
  57. text: 'Emoción es Verde',
  58. href: 'http://www.emocionesverde.com'
  59. }],
  60. user_message_prompt: 'Escribe un comentario'
  61. }, function (response) {});
  62. }
  63.  
  64. $('#swfmapsdiv').css('visibility', 'hidden');
  65. </script>
Advertisement
Add Comment
Please, Sign In to add comment