Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="fb-root"></div>
- <script language="javascript">
- var nombre = "";
- var pic_big = "";
- FB.init({
- appId : '161599150607341', // App ID
- channelUrl : '//emocionesverde.com/channel.html', // Channel File
- status : true, // check login status
- cookie : true, // enable cookies to allow the server to access the session
- xfbml : true // parse XFBML
- });
- function conectarse() {
- FB.login(handleSessionResponse, {
- scope: 'publish_stream, user_about_me'
- });
- }
- function handleSessionResponse(response) {
- if (response.authResponse) {
- FB.api('/me', function(response) {
- //console.log(response.name);
- window.nombre = response.name;
- getUserPic(response.id);
- });
- }
- }
- function getUserPic(uid) {
- FB.api('/me?fields=picture&type=large', function(response) {
- //console.log(response.picture);
- window.pic_big = response.picture;
- publicar();
- });
- }
- function publicar() {
- FB.ui({
- method: 'stream.publish',
- message: '',
- attachment: {
- name: 'Emoción es Verde',
- 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',
- media: [{
- type: 'flash',
- swfsrc: 'http://mainteractivetools.com/erik/mifb/emocionesverde/Prueba.swf?pic=' + window.pic_big + '&nombre=' + window.nombre,
- imgsrc: 'http://mainteractivetools.com/erik/mifb/emocionesverde/telefonica1.jpg',
- expanded_width: '450',
- expanded_height: '258'
- }],
- href: 'http://www.emocionesverde.com'
- },
- action_links: [{
- text: 'Emoción es Verde',
- href: 'http://www.emocionesverde.com'
- }],
- user_message_prompt: 'Escribe un comentario'
- }, function (response) {});
- }
- $('#swfmapsdiv').css('visibility', 'hidden');
- </script>
Advertisement
Add Comment
Please, Sign In to add comment