<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>radio qupido</title>
	<atom:link href="http://www.radioqupido.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.radioqupido.com</link>
	<description>Solo un altro sito WordPress</description>
	<lastBuildDate>Thu, 03 May 2012 21:44:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Ascoltare Click su Like button e commenti nella Comments box</title>
		<link>http://www.radioqupido.com/facebook/07-11-2011/ascoltare-click-su-like-button-e-commenti-nella-comments-box</link>
		<comments>http://www.radioqupido.com/facebook/07-11-2011/ascoltare-click-su-like-button-e-commenti-nella-comments-box#comments</comments>
		<pubDate>Mon, 07 Nov 2011 20:39:22 +0000</pubDate>
		<dc:creator>Michele Salvini</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[connect]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[integrazione]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[like button]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://www.radioqupido.com/?p=6</guid>
		<description><![CDATA[Questo esempio spiega come poter gestire i click sul pulsante Like e i commenti nel plugin fb:comments di Facebook inseriti nel proprio sito web Ascoltare il click sul pulsante Like button e sul pulsante Send button o l&#8217;inserimento di un commento nel plugin Comments box si può fare usando questo codice: &#60;script charset=&#34;utf-8&#34; type=&#34;text/javascript&#34; src=&#34;http://connect.facebook.net/it_IT/all.js&#34;&#62;&#60;/script&#62;&#60;script [...]]]></description>
			<content:encoded><![CDATA[<p>Questo esempio spiega come poter gestire i click sul pulsante Like e i commenti nel plugin fb:comments di Facebook inseriti nel proprio sito web</p>
<p>Ascoltare il click sul pulsante Like button e sul pulsante Send button o l&#8217;inserimento di un commento nel plugin Comments box si può fare usando questo codice:</p>
<pre class="wp-code-highlight prettyprint">&lt;script charset=&quot;utf-8&quot; type=&quot;text/javascript&quot; src=&quot;http://connect.facebook.net/it_IT/all.js&quot;&gt;&lt;/script&gt;&lt;script charset=&quot;utf-8&quot; type=&quot;text/javascript&quot;&gt;// &lt;![CDATA[
function setFacebook(){
  FB.init({ appId:'APP_ID', cookie:true, status:true, xfbml:true });
  FB.Event.subscribe('edge.create',function(href){
    voteFromFB( href1 );
  });
  FB.Event.subscribe('message.send',function(href){
    voteFromFB( href2 );
  });
  FB.Event.subscribe('comment.create',function(comment){
    commentFromFB( comment );
  });
}
// ]]&gt;&lt;/script&gt;</pre>
<p>I primi 2 argomenti &#8220;href1&#8243; e &#8220;href2&#8243; dei log saranno gli url del like che verrà pubblicato su FB, il terzo argomento &#8220;comment&#8221; è invece un oggetto:</p>
<pre class="wp-code-highlight prettyprint">{
  &quot;commentID&quot; : &quot;7124678124012745120874&quot;,
  &quot;href&quot; : &quot;href indicato nel tag  &quot;
}</pre>
<p>La funzione commentFromFB può essere scritta così con Mootools e con jQuery:</p>
<pre class="wp-code-highlight prettyprint">// Mootools
function commentFromFB( comment ){
var Req = new Request.JSON({
  url: 'script.php',
  onSuccess: function( json ){
    if( json.success ){
      alert( json.last_comment );
    } else {
      alert( 'Errore' );
    }
  }
}).post({
  'handle_comment': true,
  'href_comment': comment.href
});
}
// jQuery
function commentFromFB( comment ){
$.post( &quot;script.php&quot;,
  { 'handle_comment': true, 'href_comment': comment.href },
  function(data){
    if( data.success ){
      alert( data.last_comment );
    } else {
      alert( 'Errore' );
    }
  },
  &quot;json&quot;
);
}</pre>
<p>il file script.php gestisce la chiamata così:</p>
<pre class="wp-code-highlight prettyprint"></pre>
<p>A questo punto nel browser visualizzerete l&#8217;alert con il testo del messaggio per testare il funzionamento dello script.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.radioqupido.com/facebook/07-11-2011/ascoltare-click-su-like-button-e-commenti-nella-comments-box/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

