# Help me in wikipedia and ruby

**URL:** <https://www.ruby-forum.com/t/help-me-in-wikipedia-and-ruby/142619>\
**Category:** Rails\
**Created:** [July 9, 2008, 6:52pm UTC](https://www.ruby-forum.com/t/help-me-in-wikipedia-and-ruby/142619 "2008-07-09T18:52:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![harsh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/57b2e6/32.png) [@harsh](https://www.ruby-forum.com/u/harsh)\
**Post date:** [July 9, 2008, 6:52pm UTC](https://www.ruby-forum.com/t/help-me-in-wikipedia-and-ruby/142619/1 "2008-07-09T18:52:52Z")

</div>

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…?

---

<div class="post-metadata">

**Author:** ![harsh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/57b2e6/32.png) [@harsh](https://www.ruby-forum.com/u/harsh)\
**Post date:** [July 9, 2008, 8:36pm UTC](https://www.ruby-forum.com/t/help-me-in-wikipedia-and-ruby/142619/2 "2008-07-09T20:36:06Z")

</div>

On Jul 9, 11:52 am, harsh [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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…?

What have you tried so far?

Jeff

> **[Hey Daddio!](http://softiesonrails.com)**
>
> Home of Hey Daddio Software

---

<div class="post-metadata">

**Author:** ![harsh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/57b2e6/32.png) [@harsh](https://www.ruby-forum.com/u/harsh)\
**Post date:** [July 9, 2008, 8:41pm UTC](https://www.ruby-forum.com/t/help-me-in-wikipedia-and-ruby/142619/3 "2008-07-09T20:41:36Z")

</div>

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 =  
“[Searching - Wikipedia](http://en.wikipedia.org/wiki/Search?fulltext=Search&search=#%7Bsearch_param%7D)”  
return link\_to(text, url)  
end

does that work?

---

<div class="post-metadata">

**Author:** ![harsh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/57b2e6/32.png) [@harsh](https://www.ruby-forum.com/u/harsh)\
**Post date:** [July 9, 2008, 9:55pm UTC](https://www.ruby-forum.com/t/help-me-in-wikipedia-and-ruby/142619/4 "2008-07-09T21:55:10Z")

</div>

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](http://dbpedia.org/About)

---

<div class="post-metadata">

**Author:** ![harsh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/57b2e6/32.png) [@harsh](https://www.ruby-forum.com/u/harsh)\
**Post date:** [July 9, 2008, 8:42pm UTC](https://www.ruby-forum.com/t/help-me-in-wikipedia-and-ruby/142619/5 "2008-07-09T20:42:51Z")

</div>

Matthew R. 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 =  
> “[Searching - Wikipedia](http://en.wikipedia.org/wiki/Search?fulltext=Search&search=#%7Bsearch_param%7D)”  
> 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 =  
“[Searching - Wikipedia](http://en.wikipedia.org/wiki/Search?fulltext=Search&search=#%7Bsearch_param%7D)”  
redirect\_to url  
end

---

<div class="post-metadata">

**Author:** ![harsh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/57b2e6/32.png) [@harsh](https://www.ruby-forum.com/u/harsh)\
**Post date:** [July 9, 2008, 11:50pm UTC](https://www.ruby-forum.com/t/help-me-in-wikipedia-and-ruby/142619/6 "2008-07-09T23:50:17Z")

</div>

On 9 Jul 2008, at 20:54, Thorsten Müller wrote:

> 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 🙂

> **[Wikipedia:Database download](https://en.wikipedia.org/wiki/Wikipedia:Database_download#Where_do_I_get)**
>
> Wikipedia offers free copies of all available content to interested users. These databases can be used for mirroring, personal use, informal backups, offline use or database queries (such as for Wikipedia:Maintenance). All text content is licensed under the Creative Commons Attribution-ShareAlike 3.0 License (CC-BY-SA), and most is additionally licensed under the GNU Free Documentation License (GFDL). Images and other files are available under different terms, as detailed on their description So...

…

Fred

---

<div class="post-metadata">

**Author:** ![harsh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/57b2e6/32.png) [@harsh](https://www.ruby-forum.com/u/harsh)\
**Post date:** [August 17, 2008, 8:15pm UTC](https://www.ruby-forum.com/t/help-me-in-wikipedia-and-ruby/142619/7 "2008-08-17T20:15:48Z")

</div>

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.
