A Ruby gem for uploading images to Wikimedia Commons
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
.gitignore
.rubocop.yml
.rubocop_todo.yml
.travis.yml
Gemfile
LICENSE.txt
README.md
Rakefile
commons_upload.gemspec

README.md

commons_upload

This is a gem for uploading images to Wikimedia Commons. It uses the MediaWiki API and the mediawiki-api Ruby gem. It is currently intended for uploading auto-translated screenshots created using the screenshot gem, for documenting different MediaWiki features and extensions.

Installation

Add this line to your application's Gemfile:

gem 'commons_upload'

And then execute:

$ bundle

Or install it yourself as:

$ gem install commons_upload

Usage

To run the upload, do

# optional, the default is ./screenshots
export LANGUAGE_SCREENSHOT_PATH=./screenshots

# testing:    https://commons.wikimedia.beta.wmflabs.org/w/api.php
# production: https://commons.wikimedia.org/w/api.php
export MEDIAWIKI_API_UPLOAD_URL=https://commons.wikimedia.beta.wmflabs.org/w/api.php

export MEDIAWIKI_USER=LanguageScreenshotBot
export MEDIAWIKI_PASSWORD=not-the-real-one

bundle exec upload

Contributing

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