Get Goolge Result

Hi

i wanna write simple code like this :

puts "Please Enter you word for search in Google.com:"
x=gets
{
}

please help me what should i do ?

any simple code anyone has please put here for me
or any information has please tell me

thank you so mach

···

--
Posted via http://www.ruby-forum.com/.

If you just want that Google spits the HTML result, you can use something like

require "open-uri"

puts "Please Enter you word for search in Google.com:"
puts open("" gets.split.join(" - Google Search")).read

···

2010/2/19 Sajjad Seyyed <treep_ir@yahoo.com>:

Hi
i wanna write simple code like this :
puts "Please Enter you word for search in Google.com:"
x=gets

Eustáquio Rangel wrote:

···

2010/2/19 Sajjad Seyyed <treep_ir@yahoo.com>:

Hi
i wanna write simple code like this :
puts "Please Enter you word for search in Google.com:"
x=gets

If you just want that Google spits the HTML result, you can use
something like

require "open-uri"

puts "Please Enter you word for search in Google.com:"
puts open("" gets.split.join(" - Google Search")).read

no i wanna just show me result link

pleaseee hellppppppp meeeeeee

i neeedddddddddddddddddddd
--
Posted via http://www.ruby-forum.com/\.

no i wanna just show me result link
pleaseee hellppppppp meeeeeee

What result link? You can have thousands of links on the search result.

Eustáquio Rangel wrote:

no i wanna just show me result link
pleaseee hellppppppp meeeeeee

What result link? You can have thousands of links on the search result.

see here :

i wanna just show me result of link

pleaseeeeeeeeeeeeee

···

--
Posted via http://www.ruby-forum.com/\.

Did you just run the code I sent you?

···

2010/2/19 Sajjad Seyyed <treep_ir@yahoo.com>:

see here :
Google
i wanna just show me result of link

Eustáquio Rangel wrote:

···

2010/2/19 Sajjad Seyyed <treep_ir@yahoo.com>:

see here :
Google
i wanna just show me result of link

Did you just run the code I sent you?

what should i do ?
i need the code?
--
Posted via http://www.ruby-forum.com/\.

Find someone else to do your homework for you?

-- Matt
It's not what I know that counts.
It's what I can remember in time to use.

···

On Sat, 20 Feb 2010, Sajjad Seyyed wrote:

Eustáquio Rangel wrote:

2010/2/19 Sajjad Seyyed <treep_ir@yahoo.com>:

see here :
Google
i wanna just show me result of link

Did you just run the code I sent you?

what should i do ?
i need the code?

Matt Lawrence wrote:

···

On Sat, 20 Feb 2010, Sajjad Seyyed wrote:

Eustáquio Rangel wrote:

2010/2/19 Sajjad Seyyed <treep_ir@yahoo.com>:

see here :
Google
i wanna just show me result of link

Did you just run the code I sent you?

what should i do ?
i need the code?

Find someone else to do your homework for you?

-- Matt
It's not what I know that counts.
It's what I can remember in time to use.

see
when write RUBy in google and submit Search in google
google will bring some link for search ok ?
now i want take the links !!!
now what should i do ?

--
Posted via http://www.ruby-forum.com/\.

You should run the code I sent you. If you can't do that, I give up. :slight_smile:

···

2010/2/19 Sajjad Seyyed <treep_ir@yahoo.com>:

see
when write RUBy in google and submit Search in google
google will bring some link for search ok ?
now i want take the links !!!
now what should i do ?

Eustáquio Rangel wrote:

see
when write RUBy in google and submit Search in google
google will bring some link for search ok ?
now i want take the links !!!
now what should i do ?

You should run the code I sent you. If you can't do that, I give up. :slight_smile:

i cant
i dont have code
i want the code
please if you have give me please

thank youuuuuuuuuuuu

i needdddddddd

pleassssssssssssss

···

2010/2/19 Sajjad Seyyed <treep_ir@yahoo.com>:

--
Posted via http://www.ruby-forum.com/\.

You were provided with the code. If you can't figure out how to obtain
the code that was already given to you, I don't think anyone here can help
you.

Find someone who knows how to use a web browser and have them walk you
through it.

-s

···

On 2010-02-19, Sajjad Seyyed <treep_ir@yahoo.com> wrote:

i cant
i dont have code
i want the code
please if you have give me please

--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam@seebs.net
| Seebs.Net <-- lawsuits, religion, and funny pictures
Fair game (Scientology) - Wikipedia <-- get educated!

Eustáquio Rangel gave you an example of how to use the OpenURI module,
which would probably be the first step toward accomplishing what you want
to do. The next would be to filter the results, which may be
accomplished in a number of ways, but the simplest (and most hackish)
would probably be to use a regular expression. The rest of this should
be left as an exercise for *you*, because this mailing list, newsgroup,
or forum (depending on how you're accessing it) is for people who know or
want to learn Ruby, and not so much for people who just want to get other
people to do their work for them.

I don't know whether you are socially handicapped somehow so that you do
not realize the bad impression you are giving, and I don't know whether
you really cannot understand that someone has already provided you the
beginnings of an answer to your apparent coding issue, but I figured I'd
make the effort of trying to explain to you how you can make use of this
information in case the problem is one of communication rather than of
you wanting someone else to do your homework for you. If this is not
enough, though, I think you're probably on your own.

···

On Sat, Feb 20, 2010 at 02:20:57AM +0900, Sajjad Seyyed wrote:

Eustáquio Rangel wrote:
>
> You should run the code I sent you. If you can't do that, I give up. :slight_smile:

i cant
i dont have code
i want the code
please if you have give me please

thank youuuuuuuuuuuu

i needdddddddd

pleassssssssssssss

--
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]

We've been through this same dance with (I'm betting) the same person quite recently.
See the thread at: ? about Search in google,com and Show Result - Ruby - Ruby-Forum

There's no point in continuing to reply. Just ignore him/her at let it die.

···

On 2/19/2010 11:35 AM, Seebs wrote:

On 2010-02-19, Sajjad Seyyed<treep_ir@yahoo.com> wrote:
   

i cant
i dont have code
i want the code
please if you have give me please
     

You were provided with the code. If you can't figure out how to obtain
the code that was already given to you, I don't think anyone here can help
you.

Find someone who knows how to use a web browser and have them walk you
through it.

-s

# using 1.9.1 (I upgraded, finally, thanks to rvm!)
require 'mechanize'

internet = Mechanize.new
google = internet.get 'http://www.google.com'
form = google.forms.first
form.q = 'Ruby'
results = form.submit
results.search('//h3/a[@class="l"]').each { |link| puts link.content }