<?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>Mundo Ruby &#187; Google</title>
	<atom:link href="http://www.mundoruby.com.ar/tag/google/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mundoruby.com.ar</link>
	<description>Ruby Artists, Hackers y otras yerbas ...</description>
	<lastBuildDate>Wed, 12 Aug 2009 23:02:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Google Scrap con Rails</title>
		<link>http://www.mundoruby.com.ar/2009/06/13/google-scrap-con-rails/</link>
		<comments>http://www.mundoruby.com.ar/2009/06/13/google-scrap-con-rails/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 12:18:07 +0000</pubDate>
		<dc:creator>FreedomCoder</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://www.mundoruby.com.ar/?p=109</guid>
		<description><![CDATA[
web_search_plugin es un nuevo plugin de Rails que hice, para poder obtener los resultados de una determinada consulta en google y mostrarla en tu sitio. Hasta el momento solo realiza búsquedas en Google, a futuro lo voy a integrar con Yahoo y Live.
Instalar web_search_plugin


# cd myapprails
# ruby script/plugin install git@github.com:chebyte/web_search_plugin.git


Uso
Como ejemplo, tenemos el modelo #link.rb


 [...]]]></description>
			<content:encoded><![CDATA[<p>
<p><a href="http://github.com/chebyte/web_search_plugin/tree/master">web_search_plugin</a> es un nuevo plugin de Rails que hice, para poder obtener los resultados de una determinada consulta en google y mostrarla en tu sitio. Hasta el momento solo realiza búsquedas en Google, a futuro lo voy a integrar con Yahoo y Live.</p>
<p><strong>Instalar web_search_plugin</strong></p>
<div class="wp_syntax">
<div class="code">
<pre class="ruby ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># cd myapprails</span>
<span style="color:#008000; font-style:italic;"># ruby script/plugin install git@github.com:chebyte/web_search_plugin.git</span></pre>
</div>
</div>
<p><strong>Uso</strong><br />
Como ejemplo, tenemos el modelo #link.rb</p>
<div class="wp_syntax">
<div class="code">
<pre class="ruby ruby" style="font-family:monospace;"> <span style="color:#9966CC; font-weight:bold;">class</span> Link <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
   <span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#6666ff; font-weight:bold;">Chebyte::WebSearch</span>
   web_search
 <span style="color:#9966CC; font-weight:bold;">end</span></pre>
</div>
</div>
<p>Ahora para obtener los resultados solo debemos llamar al método search_web</p>
<div class="wp_syntax">
<div class="code">
<pre class="ruby ruby" style="font-family:monospace;"> Link.<span style="color:#9900CC;">google_search</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:query</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;tuquito&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre>
</div>
</div>
<p>esto nos devolveria</p>
<div class="wp_syntax">
<div class="code">
<pre class="ruby ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#008000; font-style:italic;">#&lt;Google::Response:0xb734d3cc @results=[{:domain=&gt;&quot;www.tuquito.org.ar&quot;, :content=&gt;&quot;Proyecto Linux de Tucumán, datos y temas relacionados al proyecto, foros y ayuda para usuarios de la distribución y descargas.&quot;, :title=&gt;&quot;Tuquito 3&quot;, :cache_url=&gt;&quot;http://www.google.com/search?q=cache:4NZXKc3gQA8J:www.tuquito.org.ar&quot;, :url=&gt;&quot;http://www.tuquito.org.ar/&quot;}, {:domain=&gt;&quot;en.wikipedia.org&quot;, :content=&gt;&quot;Oct 11, 2008 ... Tuquito is a Debian-based operating system created in Tucumán, Argentina, by Ignacio Díaz, Chris Arenas and Mauro Torres, students of The ...&quot;, :title=&gt;&quot;Tuquito - Wikipedia, the free encyclopedia&quot;, :cache_url=&gt;&quot;http://www.google.com/search?q=cache:a1xAEvHHujUJ:en.wikipedia.org&quot;, :url=&gt;&quot;http://en.wikipedia.org/wiki/Tuquito&quot;}, {:domain=&gt;&quot;www.slideshare.net&quot;, :content=&gt;&quot;Tuquito 3 Nuevo Diseño En varios idiomas (Ingles,Portugues y Español) Interfaces mas intuitivas Optimizado para la conectividad(wifi, ...&quot;, :title=&gt;&quot;Tuquito 3&quot;, :cache_url=&gt;&quot;http://www.google.com/search?q=cache:T8VfO-4iyioJ:www.slideshare.net&quot;, :url=&gt;&quot;http://www.slideshare.net/chebyte/tuquito-3&quot;}, {:domain=&gt;&quot;www.olpcnews.com&quot;, :content=&gt;&quot;OLPC Tuquito's team began to work at 1st January of 2007, with the knowledge acquisition about the project One Laptop Per Child and then with development ...&quot;, :title=&gt;&quot;OLPC Tuquito Project Progress in Argentina - OLPC News&quot;, :cache_url=&gt;&quot;http://www.google.com/search?q=cache:eoGfDNbaZ8kJ:www.olpcnews.com&quot;, :url=&gt;&quot;http://www.olpcnews.com/countries/argentina/olpc_tuquito_project_argentina.html&quot;}], @status=200, @size=4, @query=&quot;tuquito&quot;&gt;</span></pre>
</div>
</div>
<p>El resultado es un simple objecto hash, algunos de los campos disponibles son<br />
 <strong>   * title</strong> titulo del resultado<br />
   <strong> * url </strong>Url del resultado<br />
<strong>    * domain</strong> Root url del resultado<br />
  <strong>  * content </strong>contenido<br />
<strong>    * cache_url</strong> Google cache url</p>
</p>
<p>(Via <a href="http://www.chebyte.com.ar">Chebyte&#8217;s Blog</a>.)  Original Link: <a href="http://www.chebyte.com.ar/2009/06/12/google-scrap-con-rails/#comments">Google Scrap con Rails</a></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-7949681675937032";
google_ad_slot = "0874687580";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mundoruby.com.ar/2009/06/13/google-scrap-con-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

