Find file
Fetching contributors…
Cannot retrieve contributors at this time
64 lines (38 sloc) 1.91 KB


riki is a MediaWiki client written in Ruby.

Build Status Dependency Status


Add this line to your application's Gemfile:

gem 'riki'

And then execute:

$ bundle

Or install it yourself as:

$ gem install riki


Working with Wikipedia

# Optional - this step is only required if you are working with a non-english Wikipedia
Riki.url = ''

# find a page
ruby = Riki::Page.find('Ruby')

# query its properties
ruby.last_modified # some date

Working with a custom MediaWiki installation that requires authentication

# Tell riki where to  to use
Riki.url = ''
Riki.username = 'jon_doe'
Riki.password = 's3cret'

# everything else is the same as above

Commandline Client

riki comes with a simple command-line app that takes one or more titles of wikipedia pages and prints the Wikipedia page as plain text to STDOUT. Additional tools can be chained, e.g. fmt can be used to achieve word wrapping:

riki "Sinatra_(software)" | fmt -w $COLUMNS


Riki uses RestClient under the hood, to the simplest way to understand what goes wrong is to turn on logging for RestClient. For the bin script, the simplest way to achieve that is to set the appropriate environment variable:

RESTCLIENT_LOG=stdout riki Ruby

This command will invove the riki script with RestClient's logging set to STDOUT.


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request