Get Goolge Result

S

Sajjad Seyyed

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
 
E

Eustáquio Rangel

2010/2/19 Sajjad Seyyed said:
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("http://www.google.com/search?q="+gets.split.join("+")).read
 
S

Sajjad Seyyed

Eustáquio Rangel said:
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("http://www.google.com/search?q="+gets.split.join("+")).read

no i wanna just show me result link

pleaseee hellppppppp meeeeeee

i neeedddddddddddddddddddd
 
M

Matt Lawrence

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.
 
S

Sajjad Seyyed

Matt said:
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 ?
 
E

Eustáquio Rangel

2010/2/19 Sajjad Seyyed said:
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. :)
 
S

Sajjad Seyyed

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

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

thank youuuuuuuuuuuu

i needdddddddd

pleassssssssssssss
 
S

Seebs

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
 
W

Walton Hoops

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
We've been through this same dance with (I'm betting) the same person
quite recently.
See the thread at: http://www.ruby-forum.com/topic/201233#new

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

Josh Cheek

[Note: parts of this message were removed to make it a legal post.]

# 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 }
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top