<?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>Allwaysbeginner's Blog</title>
	<atom:link href="http://allwaysbeginner.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://allwaysbeginner.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Fri, 20 Mar 2009 09:43:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='allwaysbeginner.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Allwaysbeginner's Blog</title>
		<link>http://allwaysbeginner.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://allwaysbeginner.wordpress.com/osd.xml" title="Allwaysbeginner&#039;s Blog" />
	<atom:link rel='hub' href='http://allwaysbeginner.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Ruby Rails Beginner try active youtube ( activeyoutube )</title>
		<link>http://allwaysbeginner.wordpress.com/2009/03/16/ruby-rails-beginner-try-active-youtube-activeyoutube/</link>
		<comments>http://allwaysbeginner.wordpress.com/2009/03/16/ruby-rails-beginner-try-active-youtube-activeyoutube/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 10:33:32 +0000</pubDate>
		<dc:creator>allwaysbeginner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://allwaysbeginner.wordpress.com/?p=18</guid>
		<description><![CDATA[Hi All 101 Howto for activeyoutube &#38; ruby on rails . I tried to investigate web services and ruby on rails . My simple thought was try to access youtube . So I found activeyoutube (http://www.quarkruby.com/2008/1/15/activeresource-and-youtube , gem version http://www.quarkruby.com/2008/2/12/active-youtube) which I thought to use . I run in a few issues , maybe because [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwaysbeginner.wordpress.com&amp;blog=6975043&amp;post=18&amp;subd=allwaysbeginner&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:Arial;font-size:10pt;">Hi All</span></p>
<p><span style="font-family:Arial;font-size:10pt;">101 Howto for activeyoutube &amp; ruby on rails . I tried to investigate web services and ruby on rails . My simple thought was try to access youtube . So I found activeyoutube (http://www.quarkruby.com/2008/1/15/activeresource-and-youtube , gem version http://www.quarkruby.com/2008/2/12/active-youtube) which I thought to use . I run in a few issues , maybe because I am a Beginner .</span></p>
<p><span style="font-family:Arial;font-size:10pt;">First my Installation :</span></p>
<ul>
<li><span style="font-family:Arial;font-size:10pt;">Ruby on Rails 2.2.2 and 2.3.1</span></li>
</ul>
<ul>
<li><span style="font-family:Arial;font-size:10pt;">activeresource 2.2.2 and 2.3.1</span></li>
</ul>
<ul>
<li><span style="font-family:Arial;font-size:10pt;">ruby 1.86</span></li>
</ul>
<p><span style="font-family:Arial;font-size:10pt;">As I run into issues I tried both Rails Versions .</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Let’s start :</span></p>
<p><span style="font-family:Arial;font-size:10pt;">install activeyoutube :</span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><em><strong>gem install active_youtube</strong></em></span></span></p>
<p><span style="font-family:Arial;font-size:10pt;">or</span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>sudo gem install active youtube</em></strong></span></span></p>
<p><span style="font-family:Arial;font-size:10pt;">Create Rails youtube project :</span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>rails youtube</em></strong></span></span></p>
<p><span style="font-family:Arial;font-size:10pt;">Create Youtube Controller</span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>cd youtube</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>ruby script/generate controller youtube index</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>edit app/controllers/youtube_controller.rb</em></strong></span></span></p>
<p><span style="font-family:Arial;font-size:10pt;">Add Require for activeyoutube to app/controllers/youtube_controller.rb : require ‘active_youtube’</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Add Index in the controller : def index , end .</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Use the the activeyoutube example in the youtube controller for index :</span></p>
<p><span style="font-family:Arial;font-size:10pt;">copy the example section from http://www.quarkruby.com/2008/2/12/active-youtube in your controller (app/controllers/youtube_controller.rb):</span></p>
<p><span style="font-family:Arial;font-size:10pt;">app/controllers/youtube_controller.rb :</span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>require ‘active_youtube’</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>class YoutubeController {:vq =&gt; ‘ruby’, :”max-results” =&gt; ‘5’})</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>puts search.entry.length</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>## video information of id = ZTUVgYoeN_o</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>vid = Youtube::Video.find(“ZTUVgYoeN_o”)</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>puts vid.group.content[0].url</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>## video comments</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>comments = Youtube::Video.find_custom(“ZTUVgYoeN_o”).get(:comments)</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>puts comments.entry[0].link[2].href</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>## searching with category/tags</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>results = Youtube::Video.search_by_tags(“Comedy”)</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>puts results[0].entry[0].title</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>#### STANDARDFEED</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>## retrieving standard feeds</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>most_viewed = Youtube::Standardfeed.find(:most_viewed, :params =&gt; {:time =&gt; ‘today’})</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>puts most_viewed.entry[0].group.content[0].url</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>#### USER</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>## user’s profile &#8211; guthrie</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>user_profile = Youtube::User.find(“guthrie”)</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>puts user_profile.link[1].href</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>#### PLAYLIST</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>## get playlist &#8211; multiple elements in playlist</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>playlist = Youtube::Playlist.find(“EBF5D6DC4589D7B7”)</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>puts playlist.entry[0].group.content[0].url</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>end</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>end</em></strong></span></span></p>
<p><span style="font-family:Arial;font-size:10pt;">Start the rails :</span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>ruby script/server</em></strong></span></span></p>
<p><span style="font-family:Arial;font-size:10pt;">Connect to Youtube :</span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>http://localhost:3000/youtube</em></strong></span></span></p>
<p><span style="font-family:Arial;font-size:10pt;">You might get this error :</span></p>
<p><span style="font-family:Arial;font-size:10pt;">ActiveResource::ClientError in YoutubeController#index</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Failed with 406 Not Acceptable</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Issue Change in activersource from version 2.1.1 ( more info http://rails.lighthouseapp.com/projects/8994/tickets/1053-removed-http-header-accept-by-default)</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Fix :</span></p>
<p><span style="font-family:Arial;font-size:10pt;">create file lib/connection.rb</span></p>
<p><span style="font-family:Arial;font-size:10pt;">file : lib/connection.rb :</span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>module ActiveResource</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em># overrides the default ActiveResource Connection Class build_request_headers method because of this error:</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em># http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1053-removed-http-header-accept-by-default</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>class Connection</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>def build_request_headers(headers, http_method=nil)</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>authorization_header.update(default_header).update(headers).update(http_format_header(http_method))</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>authorization_header.update(default_header).update(headers)</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>end</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>end</em></strong></span></span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>end</em></strong></span></span></p>
<p><span style="font-family:Arial;font-size:10pt;">Add line on the end connection.rb to your config config/environement.rb</span></p>
<p><span style="font-family:Arial;font-size:10pt;">additional line at the end config/environement.rb:</span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>require ‘lib/connection.rb’</em></strong></span></span></p>
<p><span style="font-family:Arial;font-size:10pt;">Restart Rails :</span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>ruby scribt/server</em></strong></span></span></p>
<p><span style="font-family:Arial;font-size:10pt;">You might get the next error :</span></p>
<p><span style="font-family:Arial;font-size:10pt;">NoMethodError in YoutubeController#index</span></p>
<p><span style="font-family:Arial;font-size:10pt;">undefined method `send!’ for Youtube::Video:Class</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Issue Ruby 1.8 doesn’t seem to have send! even not all 1.9 Versions ( more Info : http://deaddeadgood.com/2008/11/17/rubys-send-method)</span></p>
<p><span style="font-family:Arial;font-size:10pt;">I changed the send! to send /Library/Ruby/Gems/1.8/gems/active_youtube-1.0.0/lib/activeyoutube.rb</span></p>
<p><span style="font-family:Arial;font-size:10pt;">New : <strong><em>“#{method_name}#{self.class.send(:query_string, options)}”</em></strong></span></p>
<p><span style="font-family:Arial;font-size:10pt;">Old : <strong><em>“#{method_name}#{self.class.send!(:query_string, options)}”</em></strong></span></p>
<p><span style="font-family:Arial;font-size:10pt;">As I am a beginner there might be a better way , this was my quick and dirty fix .</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Restart Rails :</span></p>
<p><span style="font-size:10pt;"><span style="font-family:Arial;"><strong><em>ruby script/server</em></strong></span></span></p>
<p><span style="font-family:Arial;font-size:10pt;">Connect again with the browser everything seem to work , the requested Info is in shell , not in the browser</span> yet .</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allwaysbeginner.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allwaysbeginner.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allwaysbeginner.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allwaysbeginner.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allwaysbeginner.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allwaysbeginner.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allwaysbeginner.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allwaysbeginner.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allwaysbeginner.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allwaysbeginner.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allwaysbeginner.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allwaysbeginner.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allwaysbeginner.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allwaysbeginner.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwaysbeginner.wordpress.com&amp;blog=6975043&amp;post=18&amp;subd=allwaysbeginner&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://allwaysbeginner.wordpress.com/2009/03/16/ruby-rails-beginner-try-active-youtube-activeyoutube/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/03cdfb48b1daa6501f8fc338eb49661a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">allwaysbeginner</media:title>
		</media:content>
	</item>
		<item>
		<title>Welcome</title>
		<link>http://allwaysbeginner.wordpress.com/2009/03/16/hello-world/</link>
		<comments>http://allwaysbeginner.wordpress.com/2009/03/16/hello-world/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 07:43:58 +0000</pubDate>
		<dc:creator>allwaysbeginner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Welcome to my Blog .  I am working a number of years in the IT and I allways try new stuff , I somehow experienced but not a specialist . I am amazed with the information you find , but on the other hand a lot of Info is only for specialist , so I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwaysbeginner.wordpress.com&amp;blog=6975043&amp;post=1&amp;subd=allwaysbeginner&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Welcome to my Blog .  I am working a number of years in the IT and I allways try new stuff , I somehow experienced but not a specialist . I am amazed with the information you find , but on the other hand a lot of Info is only for specialist , so I share my Information when I try new stuff and wher I struggled . I hope this helps others to save time . I also may share thoughts how some technologies can change the Business or the IT .</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allwaysbeginner.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allwaysbeginner.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allwaysbeginner.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allwaysbeginner.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allwaysbeginner.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allwaysbeginner.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allwaysbeginner.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allwaysbeginner.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allwaysbeginner.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allwaysbeginner.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allwaysbeginner.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allwaysbeginner.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allwaysbeginner.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allwaysbeginner.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=allwaysbeginner.wordpress.com&amp;blog=6975043&amp;post=1&amp;subd=allwaysbeginner&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://allwaysbeginner.wordpress.com/2009/03/16/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/03cdfb48b1daa6501f8fc338eb49661a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">allwaysbeginner</media:title>
		</media:content>
	</item>
	</channel>
</rss>
