<?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>Our Geek Space &#187; invite friends facebooker</title>
	<atom:link href="http://blog.moove-it.com/tag/invite-friends-facebooker/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.moove-it.com</link>
	<description>be free to express yourself...</description>
	<lastBuildDate>Thu, 26 Jan 2012 19:30:14 +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>Using Facebooker to make a Rails site with Facebook Connect (Part 2)</title>
		<link>http://blog.moove-it.com/using-facebooker-to-make-a-rails-site-with-facebook-connect-part-2/</link>
		<comments>http://blog.moove-it.com/using-facebooker-to-make-a-rails-site-with-facebook-connect-part-2/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 16:49:44 +0000</pubDate>
		<dc:creator>Augusto Guido</dc:creator>
				<category><![CDATA[facebook]]></category>
		<category><![CDATA[facebooker]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[facebook connect]]></category>
		<category><![CDATA[invite friends facebooker]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[XFBML]]></category>

		<guid isPermaLink="false">http://blog.moove-it.com/?p=182</guid>
		<description><![CDATA[Hey, thanks for coming back for part 2. I know it took some time to start writing this second part, it&#8217;s just that facebook keeps getting better and keeps taking my time away (don&#8217;t tell Conrado). If I remember correctly in Part 1 we ended up with facebooker installed, configured and running. We even added [...]]]></description>
			<content:encoded><![CDATA[<p>Hey, thanks for coming back for part 2. I know it took some time to start writing this second part, it&#8217;s just that facebook keeps getting better and keeps taking my time away (don&#8217;t tell Conrado).</p>
<p>If I remember correctly in Part 1 we ended up with facebooker installed, configured and running. We even added the facebook connect button and explained how to use some of the great facebooker helpers. As promised in my last post we are going to explain a bit how the magic happens with XFBML, invite friends and publish feed items.</p>
<p><strong>XFBML</strong></p>
<p>Facebook uses XFBML as a way for you to incorporate <a title="FBML" href="http://wiki.developers.facebook.com/index.php/FBML">FBML</a> (Facebook Markup Language, an extension to HTML) into an HTML page on a <a title="Facebook Connect" href="http://wiki.developers.facebook.com/index.php/Facebook_Connect">Facebook Connect</a> site or an iframe application. <a href="http://wiki.developers.facebook.com/index.php/XFBML" target="_self">read more here</a>.</p>
<p>This is a typical XFBML tag, it brings up the profile picture of the user with the uid=&#8221;12345&#8243;.</p>
<pre>
&lt;fb:profile-pic uid="12345" facebook-logo="true" linked="false" width="300" height="400"&gt;&lt;/fb:profile-pic&gt;
</pre>
<p>
What&#8217;s happening here? Facebook is turning this into a typicall HTML &lt;img&gt; tag. They do this using a Javascript cross-domain communications library. You can read more <a href="http://wiki.developers.facebook.com/index.php/Cross-domain_communication_channel" target="_blank">here</a> if you are interested. This is all done for you when using Facebooker.</p>
<p>Boring right? Let&#8217;s invite some friends to our connect site to keep things more interesting.</p>
<p><strong>Inviting Friends</strong></p>
<p>If you went through the facebooker helpers you are probably thinking about using <em>fb_multi_friend_selector</em> to select friends. Well you are right! We&#8217;ll be using that helper, but we will need it inside another helper that is<em> fb_request_form</em>. There&#8217;s also another helper that could help us that is <em>fb_multi_friend_request,</em> which is basically the first two together, but we are going to use the first option. Here&#8217;s the resulting code:</p>
<pre>
&lt;% fb_serverfbml do %&gt;
&lt;script type="text/fbml"&gt;
&lt;fb:fbml&gt;
&lt;% content_for("invite_user") do %&gt;
&lt;%= "Check out my brand new FB Connect site.  Lots of good stuff in there! #{fb_req_choice('Check it out!', login_users_url)}" %&gt;
&lt;% end %&gt;
&lt;% fb_request_form("GetUnbored","invite_user", login_users_url) do %&gt;
&lt;%= fb_multi_friend_selector("Invite your friends to check out this site", :showborder =&gt; true,
:exclude_ids =&gt; facebook_session.user.friends_with_this_app.map(&amp;:id).join(","), :condensed =&gt; false) %&gt;
&lt;% end %&gt;
&lt;/fb:fbml&gt;
&lt;/script&gt;
&lt;% end %&gt;
</pre>
<p>
I don&#8217;t want to explain something that&#8217;s already out there in many places, I will just describe a bit what&#8217;s going on. We put things inside a<em> fb_serverfbml</em>, because we are in a facebook connect site and need users interaction with facebook directly (that is when selecting their friends). The content_for(&#8220;invite_user&#8221;) is the content that will be show in the <em>fb_request_form</em>. The <em>fb_request_form</em> is a facebook form used when we need to submit information to facebook.</p>
<p>And the <em>fb_multi_friend_selector</em> is the nice facebook like friend selector. You can choose <em>condensed =&gt; true</em> to show an ugly smaller one. The <em>exclude_ids =&gt; facebook_session.user.friends_with_this_app.map(&amp;:id).join(&#8220;,&#8221;)</em> is pretty great, it makes the friend selector not to show the friends who are already using our facebook connect site.</p>
<p>Anyway, you can get much more things done, <a href="http://facebooker.rubyforge.org/classes/Facebooker/Rails/Helpers.html" target="_blank">here are some</a> of the facebooker helpers to do anything you like with them <img src='http://blog.moove-it.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . And of course the <a href="http://wiki.developers.facebook.com/">facebook developers wiki</a> is a great place for starting and becoming a guru. I will add in other post the publishing feeds part.</p>
<p>Enjoy!</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.moove-it.com/using-facebooker-to-make-a-rails-site-with-facebook-connect-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

