Monitor OSM edits made with MAPS.ME editor
Find a file
2016-06-01 12:31:41 +03:00
server Rename the main table, add user ranking 2016-05-20 17:35:45 +03:00
www Show number of users for each day 2016-06-01 12:31:41 +03:00
.gitignore fill-coords script 2016-04-08 12:44:06 +03:00
README.md Readme about different databases 2016-05-20 18:15:16 +03:00

MAPS.ME Monitoring Site

A script and a simple web page for vieweing MAPS.ME edits statistics. It is installed at osmz.ru.

Installation

First, add server/mapsme-process.py to crontab. Like this:

*/3 * * * * /var/www/sites/mmwatch/server/mapsme-process.py >> /var/www/sites/mmwatch/server/mapsme-process.log

It will create a database of changes and start updating it once every three minutes. If you need to pre-populate the database with earlier edits, comment out the cron line, delete mapsme-changes.db, edit the sequence number in mapsme-state.txt to an earlier value and run mapsme-process.py from a command line. It works rather slow, so be prepared to wait and, if unlucky, respond to OSM admins' mail about making requests to the API too often.

To set up the web interface, edit www/config.py, specifying the absolute path to the database that the above mentioned script creates. And maybe turn off DEBUG.

Then edit www/mmwatch.wsgi, adding the path to the mmwatch.py file:

import sys
sys.path.insert(0, '/var/www/sites/mmwatch/www')
from mmwatch import app as application

Now you need to add the WSGI application to your web server. Refer to this manual or maybe this one about Gunicorn.

Switching to Another Database

By default, mmwatch uses an SQLite database for keeping track of edits. You can replace it with MySQL or PostgreSQL, if you like. To do that, open server/db.py and www/mmwatch.py and replace lines with SqliteDatabase with MySQLDatabase() or PostgresqlDatabase(). See this section for their arguments.

API

There is almost no API in the service, except /user?name=<OSM User Name> call, which returns user's rank and number of edits.

Author and License

Written by Ilya Zverev, published under WTFPL.