A script and a simple web page for vieweing MAPS.ME edits statistics. It is installed at osmz.ru.
First, add server/mapsme-process.py
to crontab. Like this:
*/3 * * * * /var/www/sites/mmwatch/mmwatch/process.py >> /var/www/sites/mmwatch/mmwatch/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.
When pushing to the production, turn off DEBUG
in mmwatch/config.py
.
Now you need to add the WSGI application to your web server. Refer to this manual or maybe this one about Gunicorn.
Edit mmwatch/config.py
, replacing the DATABASE_URI
.
Refer to this section
of the Peewee documentation.
There is almost no API in the service, except /user?name=<OSM User Name>
call,
which returns user's rank and number of edits.
Written by Ilya Zverev, published under WTFPL.