<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>A Rails Techie's Blog</title>
	<atom:link href="http://arailstechie.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://arailstechie.wordpress.com</link>
	<description>all about my experience with rails</description>
	<lastBuildDate>Mon, 18 Jul 2011 13:20:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='arailstechie.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>A Rails Techie's Blog</title>
		<link>http://arailstechie.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://arailstechie.wordpress.com/osd.xml" title="A Rails Techie&#039;s Blog" />
	<atom:link rel='hub' href='http://arailstechie.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Installing linkparser gem on Snow Leopard</title>
		<link>http://arailstechie.wordpress.com/2010/02/27/i-am-posting-this-because-i-have-upgraded-to-snow-leopard/</link>
		<comments>http://arailstechie.wordpress.com/2010/02/27/i-am-posting-this-because-i-have-upgraded-to-snow-leopard/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 16:57:35 +0000</pubDate>
		<dc:creator>vibha</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[linkparser]]></category>
		<category><![CDATA[Macbook]]></category>

		<guid isPermaLink="false">http://arailstechie.wordpress.com/2010/02/27/i-am-posting-this-because-i-have-upgraded-to-snow-leopard/</guid>
		<description><![CDATA[LinkParser is a Ruby binding for the link-grammar library, a syntactic parser of English. This library requires to install the link-grammar library first. Few days back, I was working on a rails project which required this gem to be installed on the machine. An attempt to install this gem resulted in an error like this&#160;&#8230; <a href="http://arailstechie.wordpress.com/2010/02/27/i-am-posting-this-because-i-have-upgraded-to-snow-leopard/">Read&#160;more</a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arailstechie.wordpress.com&amp;blog=7610500&amp;post=38&amp;subd=arailstechie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>LinkParser is a Ruby binding for the link-grammar library, a syntactic parser of English. This library requires to install the link-grammar library first. Few days back, I was working on a rails project which required this gem to be installed on the machine. An attempt to install this gem resulted in an error like this :<br />
<code><br />
gem install linkparser<br />
Building native extensions. This could take a while...<br />
ERROR: Error installing linkparser:<br />
ERROR: Failed to build gem native extension.</p>
<p>/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb<br />
checking for dictionary_create() in -llink-grammar... no<br />
Could not find link-grammar library.<br />
(http://www.abisource.com/projects/link-grammar/#download).<br />
*** extconf.rb failed ***<br />
Could not create Makefile due to some reason, probably lack of<br />
necessary libraries and/or headers. Check the mkmf.log file for more<br />
details. You may need configuration options.</p>
<p>Provided configuration options:<br />
–with-opt-dir<br />
–without-opt-dir<br />
–with-opt-include<br />
–without-opt-include=${opt-dir}/include<br />
–with-opt-lib<br />
–without-opt-lib=${opt-dir}/lib<br />
–with-make-prog<br />
–without-make-prog<br />
–srcdir=.<br />
–curdir<br />
–ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby<br />
–with-link-grammar-dir<br />
–without-link-grammar-dir<br />
–with-link-grammar-include<br />
–without-link-grammar-include=${link-grammar-dir}/include<br />
–with-link-grammar-lib<br />
–without-link-grammar-lib=${link-grammar-dir}/lib<br />
–with-link-grammarlib<br />
–without-link-grammarlib</p>
<p>Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/linkparser-1.0.4 for inspection.<br />
Results logged to /Library/Ruby/Gems/1.8/gems/linkparser-1.0.4/ext/gem_make.out</p>
<p></code></p>
<p>I tried to find solution for this problem. Finally, I recalled that I had upgraded my system few months back to 10.6 i.e. latest version of Mac OSX. Having some good knowledge about the machine helped me to figure out the reason. Few things have changed in the OS which one should understand before upgrading the machine.</p>
<p>The key change for Ruby developers, is the fact that, in Snow Leopard, all the interpreted languages (including Ruby) are now running the 64-bit version by default, only if it is running on a 64-bit machine. And so I should have ensured the compilation of linkparser gem to produce a 64-bit binary, as this is not automatic on OSX.</p>
<p><strong>Trying this hack worked for me</strong></p>
<p><code>$ sudo env ARCHFLAGS="-arch x86_64" gem install linkparser</code></p>
<p>There are few libraries or gems which won&#8217;t properly load in Snow Leopard if you are migrating from Leopard environment where you compiled C extensions for 32 bit only and therefore needs to be recompiled for eg. mysql. Here is a simple convention which you can follow to install those gems according to the type of your machine architecture.</p>
<p><strong>To install a gem say abc</strong></p>
<p>Prior to Leopard:<br />
<code>sudo gem install abc</code></p>
<p>Leopard on a PPC machine:<br />
<code>sudo env ARCHFLAGS="-arch ppc" gem install abc</code></p>
<p>Leopard on an Intel machine:<br />
<code>sudo env ARCHFLAGS="-arch i386" gem install abc</code></p>
<p>Snow Leopard (only on Intel):<br />
<code>sudo env ARCHFLAGS="-arch x86_64" gem install abc</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arailstechie.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arailstechie.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arailstechie.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arailstechie.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/arailstechie.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/arailstechie.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/arailstechie.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/arailstechie.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arailstechie.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arailstechie.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arailstechie.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arailstechie.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arailstechie.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arailstechie.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arailstechie.wordpress.com&amp;blog=7610500&amp;post=38&amp;subd=arailstechie&amp;ref=&amp;feed=1" width="1" height="1" /><div class="sharedaddy sd-like-enabled"></div>]]></content:encoded>
			<wfw:commentRss>http://arailstechie.wordpress.com/2010/02/27/i-am-posting-this-because-i-have-upgraded-to-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9414ec3d1c63f667adc5a4ff1365b710?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">loveforweb</media:title>
		</media:content>
	</item>
		<item>
		<title>Now You Can Have Better Youtube Integration with Ruby on Rails</title>
		<link>http://arailstechie.wordpress.com/2010/02/27/now-you-can-have-better-youtube-integration-with-ruby-on-rails/</link>
		<comments>http://arailstechie.wordpress.com/2010/02/27/now-you-can-have-better-youtube-integration-with-ruby-on-rails/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 16:56:43 +0000</pubDate>
		<dc:creator>vibha</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://arailstechie.wordpress.com/2010/02/27/now-you-can-have-better-youtube-integration-with-ruby-on-rails/</guid>
		<description><![CDATA[I recently wanted to upload, edit, update and delete a video directly on youtube from my rails application. This can be achieved by YouTube Data API that allows application to perform functions normally executed on youtube. Step 1 : Demystifying Authentication with Google AuthSub Google provides an authentication service to those web applications that need&#160;&#8230; <a href="http://arailstechie.wordpress.com/2010/02/27/now-you-can-have-better-youtube-integration-with-ruby-on-rails/">Read&#160;more</a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arailstechie.wordpress.com&amp;blog=7610500&amp;post=37&amp;subd=arailstechie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently wanted to upload, edit, update and delete a video directly on youtube from my rails application. This can be achieved by YouTube Data API that allows application to perform functions normally executed on youtube.</p>
<p><strong>Step 1 : Demystifying Authentication with Google AuthSub</strong></p>
<p>Google provides an authentication service to those web applications that need to access services protected by a user’s Google account. I chose<a href="http://code.google.com/apis/accounts/docs/AuthSub.html"> Google’s ‘AuthSub’ scheme</a> for this. This also provides a high level of security to web application.<br />
The AuthSub interface provides several methods for acquiring and managing authorization tokens. Once a web application has received a token, it can request access to a Google service.</p>
<p>To obtain an authentication token, submit an HTTP POST request to the following URL:</p>
<p><code>1.<a href="https://www.google.com/accounts/AuthSubRequest?">https://www.google.com/accounts/AuthSubRequest?</a>next=http%3A%2F%2Fwww.example.com%2Fupload.html&amp;scope=http%3A%2F%2Fgdata.youtube.com&amp;session=0&amp;secure=0<br />
</code></p>
<p>Setting session parameter to 1 indicates that the single-use token can be exchanged for a session token.<br />
<a href="http://code.google.com/apis/accounts/docs/AuthSub.html#AuthSubSessionToken">AuthSubSessionToken</a> is a method that allows the web application to exchange a single-use token for a session token. I used a gem ‘gdata’ to convert the token into a session token.</p>
<div id="highlighter_121142">
<div><code>1.client = GData::Client::DocList.new</code></div>
<div><code>2.client.authsub_token = params[:token]</code></div>
<div><code>3.session[:token] = client.auth_handler.upgrade()</code></div>
</div>
<p>Session token allows the application to make unlimited calls to the Google service. When using session tokens, your application should store the session token for each user rather than requesting a new one each time it needs to access a Google service. For other token management options, see <a href="http://code.google.com/apis/accounts/docs/AuthSub.html#WorkingAuthSub">Working With AuthSub.</a></p>
<p><strong>Step 2 : Getting the Youtube Developer Key</strong></p>
<p>A developer key is required that identifies the YouTube developer that is submitting an API request. A client ID identifies your application for logging and debugging purposes. Please visit <a href="http://code.google.com/apis/youtube/dashboard/">here</a> to obtain a developer key and client ID.</p>
<p><strong>Step 3 : Improving the Youtube Model</strong> <strong>Plugin</strong></p>
<p><a href="http://github.com/edgarjs/youtube-model/tree/master">“youtube-model”</a> is a plugin  that provides youtube video uploading functionality. That was a good start.<br />
I forked the plugin and updated it with few methods to get the rest of  the functionality done. Each method is explained here.<br />
<strong>1. uploaded_by_user</strong><br />
A method uploaded_by was provided in the plugin to retrieve all the videos of the user but it receives username as a parameter. So I added a method uploaded_by_user that receives the session token and solves our purpose.</p>
<div id="highlighter_455398">
<div>
<div><code>1.YouTube.uploaded_by_user(session[:token])</code></div>
</div>
<p><strong>2. update_video</strong><br />
The video can be updated by using this method passing video id, session token and params hash as parameters.</p>
<div id="highlighter_387895">
<div>
<div>
<div><code>1.YouTube.update_video(params[:id], session[:token], params[:you_tube_entry])</code></div>
</div>
</div>
<p><strong>3. delete_video</strong><br />
The video can also be deleted if uploaded at the user’s youtube account by passing video id and token as a parameter.</p>
<div id="highlighter_43209">
<div>
<div><code>1.YouTube.delete_video(params[:id], session[:token])</code></div>
</div>
</div>
<p><strong>4. video_status</strong><br />
This method helps finding out the status of uploaded video.</p>
<div id="highlighter_788311">
<div>
<div><code>1. s = YouTube.video_status(session[:token], params[:id])</code></div>
<div><code>2. @status = s.control.state.name</code></div>
</div>
</div>
<p>The changes to the plugin have been merged in the master and you can download everything <a href="http://github.com/vibha/youtube-model/tree/master">here</a>. I will really appreciate your feedback and suggestions to make this plugin better.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arailstechie.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arailstechie.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arailstechie.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arailstechie.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/arailstechie.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/arailstechie.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/arailstechie.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/arailstechie.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arailstechie.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arailstechie.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arailstechie.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arailstechie.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arailstechie.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arailstechie.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arailstechie.wordpress.com&amp;blog=7610500&amp;post=37&amp;subd=arailstechie&amp;ref=&amp;feed=1" width="1" height="1" /><div class="sharedaddy sd-like-enabled"></div>]]></content:encoded>
			<wfw:commentRss>http://arailstechie.wordpress.com/2010/02/27/now-you-can-have-better-youtube-integration-with-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9414ec3d1c63f667adc5a4ff1365b710?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">loveforweb</media:title>
		</media:content>
	</item>
	</channel>
</rss>
