Project

riki

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
MediaWiki client
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 1.8

Runtime

 Project Readme

Riki

riki is a MediaWiki client written in Ruby.

Build Status Dependency Status

Installation

Add this line to your application's Gemfile:

gem 'riki'

And then execute:

$ bundle

Or install it yourself as:

$ gem install riki

Usage

Working with Wikipedia

# Optional - this step is only required if you are working with a non-english Wikipedia
Riki.url = 'http://de.wikipedia.org/w/api.php'

# 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 = 'http://example.com/wiki/api.php'
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

Troubleshooting

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.

Contributing

  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