help me in wikipedia and ruby

pls help me if any material is there so that i can directly connect
my
data to wikipedia search if any one wants...
for examle if anyone typed the text like india or some other u and one
wants to get the information about india so how should i connect the
wikipedia page with my application.........?

What have you tried so far?

Jeff
softiesonrails.com

harsh wrote:

pls help me if any material is there so that i can directly connect
my
data to wikipedia search if any one wants...
for examle if anyone typed the text like india or some other u and one
wants to get the information about india so how should i connect the
wikipedia page with my application.........?

think you just need a view helper;

require 'uri'
def wikipedia_link(text)
  search_param = URI.encode(text)
  url =
"http://en.wikipedia.org/wiki/Search?fulltext=Search&search=#{search_param}"
  return link_to(text, url)
end

does that work?

Matthew Rudy Jacobs wrote:

harsh wrote:

pls help me if any material is there so that i can directly connect
my
data to wikipedia search if any one wants...
for examle if anyone typed the text like india or some other u and one
wants to get the information about india so how should i connect the
wikipedia page with my application.........?

think you just need a view helper;

require 'uri'
def wikipedia_link(text)
  search_param = URI.encode(text)
  url =
"http://en.wikipedia.org/wiki/Search?fulltext=Search&search=#{search_param}"
  return link_to(text, url)
end

does that work?

or maybe you wanted a controller action :wiki_search or something

def wiki_search
  search_param = URI.encode(params[:query])
  url =
"http://en.wikipedia.org/wiki/Search?fulltext=Search&search=#{search_param}"
  redirect_to url
end

As far as I know, wikipedia has no API that would allow
to get information directly (like amazon has for example)
So you can only use Matthews way to go with the URL.

There is dbpedia, some approach to get wikipedia in a
form for querying, but I don't know if it's any good.

http://dbpedia.org/About

As far as I know, wikipedia has no API that would allow
to get information directly (like amazon has for example)
So you can only use Matthews way to go with the URL.

Or download a whole dump of wikipedia :slight_smile: http://en.wikipedia.org/wiki/Wikipedia:Database_download#Where_do_I_get
...

Fred

sir i have tried to connect a web page with the help of ruby to
retrive the source code of html.
then i want to break it up in samll paras so that necessary
information should be displayed to the children in changed fonts and
size.