source: subversion/applications/utils/revert/download_changesets.sh @ 30254

Last change on this file since 30254 was 30191, checked in by frederik, 6 years ago

script to collect changesets of one user

File size: 866 bytes
Line 
1#!/bin/sh
2
3# script to download all changesets of one user since
4# a given date (to get ALL, set date to before their signup)
5# API currently limited to listing max. 100 changesets,
6# therefore loop required
7
8USER=someuser
9SINCE=2013-11-01T00:00:00
10
11# no user servicable parts below. run this in empty directory
12# and you'll end up with tons of files called c1234.osc (one
13# for each changeset)
14
15T=`date +%Y-%m-%dT%H:%M:%S`
16export T
17
18while /bin/true
19do
20
21wget -Olist "http://api.openstreetmap.org/api/0.6/changesets?display_name=$USER&time=$SINCE,$T" 
22T=`grep "<changeset" list|tail -1|cut -d\" -f8`
23
24if grep -q "<changeset" list
25then
26cat list | grep "<changeset" | cut -d\" -f2 | while read id
27do
28    rm -f list
29    [ -f c$id.osc ] && exit
30    wget -Oc$id.osc http://api.openstreetmap.org/api/0.6/changeset/$id/download
31done
32else
33    rm -f list
34    exit
35fi
36
37done
Note: See TracBrowser for help on using the repository browser.