Create a sparkline to visualise your MediaWiki contributions.
This project is a web server that:
- Retrieves your MediaWiki contributions from the API of your MediaWiki instance.
- Plots your contributions on a timeline over the last 90 days.
- Renders an SVG file with a sparkline. a. The line chart sparkline was made by kryogenix.org (used with permission). b. The bar chart sparkline was made by me.
A hosted version of the sparkline service is available at sparkline.jamesg.blog.
The root endpoint for the service is:
https://sparkline.jamesg.blog
The following query string parameters are required:
api_url
: The root URL for your MediaWiki API.username
: Your MediaWiki username.
The following values are optional:
days
: Number of days in history for which you want to retrieve stats. Min 1. Max 120.only_image
: By default, the API returns a text page with some meta information and the sparkline embedded. Specify anonly_image
value to retrieve only an image.is_bar
: Return a bar chart. This option is experimental.
Please note the username
attribute is case sensitive.
Here is an example query to the endpoint:
https://sparkline.jamesg.blog/?username=Jamesg.blog&api_url=https://indieweb.org/wiki/api.php&only_image=true
This query returns a line sparkline graph my IndieWeb wiki contributions. The result is an SVG file.
First, install the required dependencies for this project. You can do this using the following command:
bundle install
Next, run the sparkline server:
ruby sparkline.rb
This project is built in Ruby.
This project is licensed under an MIT 0 license.
Thank you to Stuart Langridge for allowing me to use his simple SVG sparkline file for the line graph chart.
- capjamesg