<?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>game, game. repeat. &#187; ruby on rails</title>
	<atom:link href="http://ggr.com/tag/ruby-on-rails/feed" rel="self" type="application/rss+xml" />
	<link>http://ggr.com</link>
	<description>if Scott Bonds had a home on the interwebs, this would be it</description>
	<lastBuildDate>Tue, 09 Feb 2010 00:59:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How To Use Facebook Open Streams With Facebooker</title>
		<link>http://ggr.com/how-to-use-facebook-open-streams-with-facebooker.html</link>
		<comments>http://ggr.com/how-to-use-facebook-open-streams-with-facebooker.html#comments</comments>
		<pubDate>Tue, 15 Sep 2009 22:02:40 +0000</pubDate>
		<dc:creator>Scott Bonds</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[authlogic]]></category>
		<category><![CDATA[authlogic facebook connect plugin]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[facebook connect]]></category>
		<category><![CDATA[facebooker]]></category>
		<category><![CDATA[news feed]]></category>
		<category><![CDATA[open streams api]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[stream]]></category>
		<category><![CDATA[stream.publish]]></category>

		<guid isPermaLink="false">http://ggr.com/?p=395</guid>
		<description><![CDATA[
I would like my Facebook Connect app to publish stories to my users&#8217; Facebook news stream.  I went looking for how do this with Facebooker and figured out an answer.

The old way of doing this, and the one built into Facebooker, is to publish a user action.  There are two limitations of the [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://ggr.com/how-to-use-facebook-open-streams-with-facebooker.html"><img class="size-full wp-image-399 aligncenter" title="facebook_extended_permissions" src="http://ggr.com/wp-content/uploads/facebook_extended_permissions.jpg" alt="facebook_extended_permissions" width="580" height="287" /></a></p>
<p>I would like my Facebook Connect app to publish stories to my users&#8217; Facebook news stream.  I went looking for how do this with Facebooker and figured out an answer.</p>
<p><span id="more-395"></span></p>
<p>The <a href="http://wiki.developers.facebook.com/index.php/Feed.publishUserAction">old way</a> of doing this, and the one built into Facebooker, is to <a href="http://facebooker.rubyforge.org/classes/Facebooker/Rails/Publisher.html">publish a user action</a>.  There are two limitations of the old way: 1: you need a valid session_key (so, the user must be logged in); 2: you may only send up to 10 messages per day (without special permissions from the user).</p>
<p>Fortunately Facebook released their <a href="http://wiki.developers.facebook.com/index.php/Using_the_Open_Stream_API">Open Stream API</a> in April 2009 and it suffers from neither restriction: you can post without a session_key and there are no explicit limits on how many posts you can make in a day.  Unfortunately Facebooker does not yet offer native support for publishing to Facebook streams, at least that I could find, but it DOES support rolling your own API calls, and in this case its not that hard to do.  To post to a users&#8217; Facebook stream from your Rails app&#8217;s script/console, do the following:</p>
<ol>
<li>Integrate Facebooker into your Rails app.  Verify that it works.  There are a number of ways to integrate Facebooker depending on what kind of app you are making.  e.g. I&#8217;m making a Facebook Connect app, so I used <a href="http://github.com/binarylogic/authlogic">AuthLogic</a> and the <a href="http://github.com/kalasjocke/authlogic_facebook_connect">AuthLogic Facebook Connect plugin</a> so users can login to my app using their Facebook credentials.</li>
<li>Get a user&#8217;s <a href="http://wiki.developers.facebook.com/index.php/Extended_permission">permission to publish</a> to their stream.  Make a note of their Facebook UID.  e.g. in my app, the AuthLogic Facebook Connect plugin stores the UID in my user table each time a new Facebook user logs into my site.</li>
<li>Run script/console and execute the following commands:</li>
</ol>
<p><code><strong> f = Facebooker::Session.create<br />
f.post 'facebook.stream.publish', :uid =&gt; '&lt;insert_facebook_uid_here&gt;', :message =&gt; 'test'<br />
</strong> </code></p>
<p>Not so bad, huh?</p>
]]></content:encoded>
			<wfw:commentRss>http://ggr.com/how-to-use-facebook-open-streams-with-facebooker.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How To Permit A Blank Email Field With AuthLogic</title>
		<link>http://ggr.com/how-to-permit-a-blank-email-field-with-authlogic.html</link>
		<comments>http://ggr.com/how-to-permit-a-blank-email-field-with-authlogic.html#comments</comments>
		<pubDate>Wed, 09 Sep 2009 19:32:12 +0000</pubDate>
		<dc:creator>Scott Bonds</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[authlogic]]></category>
		<category><![CDATA[blank email]]></category>
		<category><![CDATA[empty email]]></category>
		<category><![CDATA[no email]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://ggr.com/?p=380</guid>
		<description><![CDATA[
I too ran into some trouble before discovering that my beloved AuthLogic is validating my email field.  The validation is a good thing overall, but I want to support blank email addresses as well as properly formatted ones.

It&#8217;s all in the AuthLogic docs of course, but if I can save you a few minutes [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://ggr.com/how-to-permit-a-blank-email-field-with-authlogic.html"><img class="size-full wp-image-381 aligncenter" title="errors from blank email with AuthLogic" src="http://ggr.com/wp-content/uploads/errors-from-blank-email-with-AuthLogic.jpg" alt="errors from blank email with AuthLogic" width="580" height="282" /></a></p>
<p>I too <a href="http://ficial.wordpress.com/2009/03/15/ruby-on-rails-getting-error-messages-authlogic-email-validation/">ran into some trouble</a> before discovering that my beloved AuthLogic is validating my email field.  The validation is a good thing overall, but I want to support blank email addresses as well as properly formatted ones.</p>
<p><span id="more-380"></span></p>
<p>It&#8217;s all in the AuthLogic docs of course, but if I can save you a few minutes of hunting around, that&#8217;s all good:</p>
<p><code><br />
acts_as_authentic do |c|<br />
&nbsp;&nbsp;c.merge_validates_length_of_email_field_options({:allow_nil =&gt; true})<br />
&nbsp;&nbsp;c.merge_validates_format_of_email_field_options({:allow_nil =&gt; true})<br />
end<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://ggr.com/how-to-permit-a-blank-email-field-with-authlogic.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
