Read wikipedia content into your Ruby on Rails app

I am playing around with a new site that helps people find horses for sale, aptly named  I wanted to provide searchers some background on the particular horse breed they were looking at, so I decided to provide the first few paragraphs from the wikipedia page for that horse breed, and then link off to the full wikipedia page.  For example, see the content on the lower left of the paso fino horses for sale page.

After some searching around, I found the perfect tool – the wikipedia-client gem on github.   As Judge Smails from Caddy Shack would say, “top notch, top notch!”

Here’s some quick code:

      page = Wikipedia.find(horse_page_name)
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s