# Simple Ruby Project

**URL:** <https://www.ruby-forum.com/t/simple-ruby-project/179410>\
**Category:** Ruby\
**Created:** [November 24, 2009, 2:00pm UTC](https://www.ruby-forum.com/t/simple-ruby-project/179410 "2009-11-24T14:00:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/838e76/32.png) [@rob](https://www.ruby-forum.com/u/rob)\
**Post date:** [November 24, 2009, 2:00pm UTC](https://www.ruby-forum.com/t/simple-ruby-project/179410/1 "2009-11-24T14:00:30Z")

</div>

Hello all,

I’ve just started with Ruby and decided to do a little project. Since  
this is my first time doing  
something related with the internet, I could sure use some guidelines.  
Let me first tell you what my project is.

I’m planning to create a simple web page, with only an input box. The  
input should be used  
as a search term that will retrieve the results from google and  
display them on my page.

Simple enough, I still have some question regarding the design. Here  
they are:

1.) I’m planning to do this as simple as possible. I know how to  
retireve data from google,  
therefore I will create only a simple class which will then be  
imported into the  
HTML file. Is this a good idea, or is there another, simpler/cleaner/  
better way?

2.) Is the best way to retrieve the data as a HTML page and work by  
reading lines,  
cleaning the clutter with simple regex methods?

Thank you for your help.

---

<div class="post-metadata">

**Author:** ![rob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/838e76/32.png) [@rob](https://www.ruby-forum.com/u/rob)\
**Post date:** [November 24, 2009, 2:19pm UTC](https://www.ruby-forum.com/t/simple-ruby-project/179410/2 "2009-11-24T14:19:49Z")

</div>

Rob wrote:

> display them on my page.
> 
> 2.) Is the best way to retrieve the data as a HTML page and work by  
> reading lines,  
> cleaning the clutter with simple regex methods?
> 
> Thank you for your help.

Hi and welcome,

there is a good library for similar things: [http://nokogiri.org/](http://nokogiri.org/)  
have a look at the small example in the middle of the page

best regards  
ralf

---

<div class="post-metadata">

**Author:** ![rob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/838e76/32.png) [@rob](https://www.ruby-forum.com/u/rob)\
**Post date:** [November 24, 2009, 2:29pm UTC](https://www.ruby-forum.com/t/simple-ruby-project/179410/3 "2009-11-24T14:29:46Z")

</div>

Rob wrote:

> I’m planning to create a simple web page, with only an input box. The  
> input should be used  
> as a search term that will retrieve the results from google and  
> display them on my page.

So you will need to run this under a web server, to allow your client to  
POST the input box contents to your application.

It sounds like you’re considering rhtml or cgi-bin. Those would work,  
but I think you should have a look at Sinatra too. It’s very simple and  
neat.

---

<div class="post-metadata">

**Author:** ![rob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/838e76/32.png) [@rob](https://www.ruby-forum.com/u/rob)\
**Post date:** [November 24, 2009, 3:25pm UTC](https://www.ruby-forum.com/t/simple-ruby-project/179410/4 "2009-11-24T15:25:57Z")

</div>

Thanks for all the help guys, I appreciate it. I also thought rails is  
a bit too much, but I’ll def try Sinatra. Thanks again.

---

<div class="post-metadata">

**Author:** ![rob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/838e76/32.png) [@rob](https://www.ruby-forum.com/u/rob)\
**Post date:** [November 24, 2009, 3:07pm UTC](https://www.ruby-forum.com/t/simple-ruby-project/179410/5 "2009-11-24T15:07:42Z")

</div>

Rob wrote:

> Hello all,
> 
> I’ve just started with Ruby and decided to do a little project. Since  
> this is my first time doing  
> something related with the internet, I could sure use some guidelines.  
> Let me first tell you what my project is.
> 
> I’m planning to create a simple web page, with only an input box. The  
> input should be used  
> as a search term that will retrieve the results from google and  
> display them on my page.
> 
> Simple enough, I still have some question regarding the design. Here  
> they are:
> 
> 1.) I’m planning to do this as simple as possible. I know how to  
> retireve data from google,  
> therefore I will create only a simple class which will then be  
> imported into the  
> HTML file. Is this a good idea, or is there another, simpler/cleaner/  
> better way?

It’s probably a good idea to use one of the lighter-weight Web  
frameworks such as Sinatra or Merb for this. (Rails is probably  
overkill for a project like this, but you might want to consider it.)

> 2.) Is the best way to retrieve the data as a HTML page and work by  
> reading lines,  
> cleaning the clutter with simple regex methods?

Why not use the Google Search API?

> Thank you for your help.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
