<?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; facebook</title>
	<atom:link href="http://blog.moove-it.com/category/facebook/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 3)</title>
		<link>http://blog.moove-it.com/using-facebooker-to-make-a-rails-site-with-facebook-connect-part-3/</link>
		<comments>http://blog.moove-it.com/using-facebooker-to-make-a-rails-site-with-facebook-connect-part-3/#comments</comments>
		<pubDate>Mon, 25 May 2009 17:41:29 +0000</pubDate>
		<dc:creator>Augusto Guido</dc:creator>
				<category><![CDATA[facebook]]></category>
		<category><![CDATA[facebooker]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[facebook connect]]></category>
		<category><![CDATA[publish feed]]></category>
		<category><![CDATA[publish stories]]></category>

		<guid isPermaLink="false">http://blog.moove-it.com/?p=185</guid>
		<description><![CDATA[Welcome to part 3 of the facebooker trilogy I&#8217;m kind of tyred of writing the same title over and over again and changing just the last number, problem is there are so many things we can do with this stuff we could write tons of this. I could put in the title what we will [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to part 3 of the facebooker trilogy</p>
<p>I&#8217;m kind of tyred of writing the same title over and over again and changing just the last number, problem is there are so many things we can do with this stuff we could write tons of this. I could put in the title what we will talk about specifically in this post, but the idea is to follow this post/tutorials in order. This will probably be the last part of this set of posts, the following ones will refer in it&#8217;s specifically to what will be done.</p>
<p>So far we explained how to configure facebooker, sign up, invite friends and bit of the theory. So today we&#8217;ll publish something in the users dashboard, so him and all his friends can see it his wall. So go to<br />
<a href="http://developers.facebook.com/tools.php">developers.facebook.com/tools.php</a> and select &#8220;Feed Template Console&#8221;, select the application you want and click next.</p>
<p>Give me a minute to explain you what we are doing.</p>
<p>We are going to register our feeds in facebook, and then we are going to call them by a number they will give us.<br />
You can do this using facebooker, or you can register them in the link I gave you above. I think that using the facebook tools is way easier and also facebooker may be a bit out of date regarding this area due to all the legal and business changes in facebook. Also not event facebook has yet clear what they want: &#8220;At this time, the policy on automatically publishing one line stories has not been finalized&#8221;.</p>
<p>Anyway, complete the step guide for feeds in facebook and keep the number of the template you created. BTW while completing it you will find this kind of stuff &#8220;{*actor*}&#8221; without quotes. These are tokens that allow to put variable stuff (like names, links, etc.), you can read about them while creating the templates since they are well explained over there.</p>
<p>Now, you have the story. You need the users approval to publish it, so what facebook does is shows the story to the user and gives him otions to skip or publish. If we are in luck the users hits &#8220;publish&#8221;.</p>
<p>So we now obviously want to show it to the user so he can choose. Here&#8217;s the code</p>
<pre>
FB.ensureInit(function() {
var body_general = "Join them in my facebook connect site"
var template_data =
{
"actor":  "&lt;%= @_logged_user.name %&gt;",
"friends":"&lt;%= @event.users.collect{|u| u.name_or_alias}.join(', ') %&gt;",
"event":  "&lt;%= @event.description %&gt;",
"place":  "&lt;%= @event.place %&gt;",
"time" :  "&lt;%= @event.start.strftime('%m/%d/%Y %I:%M %p') %&gt;"
};
var user_message_prompt = "&lt;%= @match.comment %&gt;";
FB.Connect.showFeedDialog('the_number_of_your_template', template_data, [], body_general, null, FB.RequireConnect.require, FB.RequireConnect.promptConnect, user_message_prompt);
});
</pre>
<p>In the template data you have to complete the tokens you created when publishing your story. You can everything pretty well explained in this couple of links:</p>
<p><a href="http://wiki.developers.facebook.com/index.php/Publishing_Feed_Stories_to_Facebook">http://wiki.developers.facebook.com/index.php/JS_API_M_FB.Connect.ShowFeedDialog</a><br />
<a href="http://wiki.developers.facebook.com/index.php/Feed.publishUserAction">http://wiki.developers.facebook.com/index.php/Feed.publishUserAction</a><br />
<a href="http://wiki.developers.facebook.com/index.php/Publishing_Feed_Stories_to_Facebook">http://wiki.developers.facebook.com/index.php/Publishing_Feed_Stories_to_Facebook</a></p>
<p>Pay attention to the <em>&#8220;FB.ensureInit(function(){&#8220;</em>, I don&#8217;t know why I couldn&#8217;t find anywhere in facebook that mention this should be there. If you don&#8217;t add this nothing will happen, maybe it&#8217;s obvios for some people, but it wasn&#8217;t for me. I&#8217;m sory I can&#8217;t remember where I find this, but you can read <a href="http://wiki.developers.facebook.com/index.php/JS_API_M_FB.EnsureInit">here</a> what it does.</p>
<p>Well, that&#8217;s kind of the big picture of what you have to do to publish stories, remember this isn&#8217;t supposed to be a complete tutorial of everything you can do, just a guide based on my personal experience to get started.</p>
<p>Your facebook connect site should be quite complete now that you can signup, invite your friends and write stuff that will appear directly in facebook. Not to mention if you have used all the other resources facebook give us and facebooker facilitate us.</p>
<p>Thanks for reading!</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.moove-it.com/using-facebooker-to-make-a-rails-site-with-facebook-connect-part-3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<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>

