Rails + MediaWiki API to retrieve data on Wikipedia

I am trying to use Rails to retrieve data from Wikipedia based on a search query.

For instance,

1) if I have a String "American Idol", I want to submit this to Wikipedia and get a list of articles related to this. My goal is to take the first 3 hyperlinks and display them on the website.

2) another step will require me to extract small pieces of data from Wikipedia - say, infobox or the first few words of a Wikipedia article.

Any tips?

Thank!

+5
source share
3 answers
+5
+1

Use mechanize and nokogiri for this. This is a great trickster for this:

http://www.e-tobi.net/blog/files/ruby-mechanize-cheat-sheet.pdf

The engine is a tool to simulate website calls, and nokogiri is an html / xml parser. It should be easy to understand that.

0
source

All Articles